Fix ArrayIndexOutOfBoundsException
Dieser Commit ist enthalten in:
Ursprung
6f558b6b91
Commit
29c3e954be
@ -10,7 +10,7 @@ public class TNTTrace {
|
||||
private int uniqueID;
|
||||
|
||||
private int index = 0;
|
||||
private float[] positions = new float[243];
|
||||
private float[] positions = new float[240];
|
||||
|
||||
public TNTTrace(int uniqueID) {
|
||||
this.uniqueID = uniqueID;
|
||||
@ -21,6 +21,9 @@ public class TNTTrace {
|
||||
}
|
||||
|
||||
public void addLocation(double x, double y, double z) {
|
||||
if (index >= positions.length) {
|
||||
positions = Arrays.copyOf(positions, positions.length + 240);
|
||||
}
|
||||
positions[index + 0] = (float)x;
|
||||
positions[index + 1] = (float)y;
|
||||
positions[index + 2] = (float)z;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren