Fix ArrayIndexOutOfBoundsException #75
@ -10,7 +10,7 @@ public class TNTTrace {
|
|||||||
private int uniqueID;
|
private int uniqueID;
|
||||||
|
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
private float[] positions = new float[243];
|
private float[] positions = new float[240];
|
||||||
|
|
||||||
public TNTTrace(int uniqueID) {
|
public TNTTrace(int uniqueID) {
|
||||||
this.uniqueID = uniqueID;
|
this.uniqueID = uniqueID;
|
||||||
@ -21,6 +21,9 @@ public class TNTTrace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addLocation(double x, double y, double z) {
|
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 + 0] = (float)x;
|
||||||
positions[index + 1] = (float)y;
|
positions[index + 1] = (float)y;
|
||||||
positions[index + 2] = (float)z;
|
positions[index + 2] = (float)z;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren