Optimized a little too much. Update goals every tick again to avoid AI oddness.
Dieser Commit ist enthalten in:
Ursprung
8f1fc96da0
Commit
40be9c8403
@ -6,10 +6,9 @@ import org.bukkit.craftbukkit.util.UnsafeList; // CraftBukkit
|
|||||||
|
|
||||||
public class PathfinderGoalSelector {
|
public class PathfinderGoalSelector {
|
||||||
|
|
||||||
// CraftBukkit start - use UnsafeList, add boolean for picking goals
|
// CraftBukkit start - use UnsafeList
|
||||||
private UnsafeList a = new UnsafeList(16);
|
private UnsafeList a = new UnsafeList(16);
|
||||||
private UnsafeList b = new UnsafeList(16);
|
private UnsafeList b = new UnsafeList(16);
|
||||||
boolean oddCall = true;
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public PathfinderGoalSelector() {}
|
public PathfinderGoalSelector() {}
|
||||||
@ -21,8 +20,7 @@ public class PathfinderGoalSelector {
|
|||||||
public void a() {
|
public void a() {
|
||||||
//ArrayList arraylist = new ArrayList(); // CraftBukkit - removed usage
|
//ArrayList arraylist = new ArrayList(); // CraftBukkit - removed usage
|
||||||
|
|
||||||
// CraftBukkit start - don't use iterators for private fields, only run every other call
|
// CraftBukkit start - don't use iterators for private fields
|
||||||
if (oddCall) {
|
|
||||||
for (int i = 0; i < this.a.size(); i++) {
|
for (int i = 0; i < this.a.size(); i++) {
|
||||||
PathfinderGoalSelectorItem pathfindergoalselectoritem = (PathfinderGoalSelectorItem) this.a.unsafeGet(i); // CraftBukkit - use unsafeGet
|
PathfinderGoalSelectorItem pathfindergoalselectoritem = (PathfinderGoalSelectorItem) this.a.unsafeGet(i); // CraftBukkit - use unsafeGet
|
||||||
boolean flag = this.b.contains(pathfindergoalselectoritem);
|
boolean flag = this.b.contains(pathfindergoalselectoritem);
|
||||||
@ -44,8 +42,6 @@ public class PathfinderGoalSelector {
|
|||||||
this.b.add(pathfindergoalselectoritem);
|
this.b.add(pathfindergoalselectoritem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
oddCall = !oddCall;
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren