diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-04-24 22:18:27 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-04-24 23:20:29 -0400 |
commit | 40be9c84032216b4e1f4d078a2129c370d5e161f (patch) | |
tree | b33436594042a490965757d4e24c0510a8401b3f /src/main/java/net/minecraft/server/PathfinderGoalSelector.java | |
parent | 8f1fc96da0f9c08a585797947994c162389bbaf6 (diff) | |
download | craftbukkit-40be9c84032216b4e1f4d078a2129c370d5e161f.tar craftbukkit-40be9c84032216b4e1f4d078a2129c370d5e161f.tar.gz craftbukkit-40be9c84032216b4e1f4d078a2129c370d5e161f.tar.lz craftbukkit-40be9c84032216b4e1f4d078a2129c370d5e161f.tar.xz craftbukkit-40be9c84032216b4e1f4d078a2129c370d5e161f.zip |
Optimized a little too much. Update goals every tick again to avoid AI oddness.
Diffstat (limited to 'src/main/java/net/minecraft/server/PathfinderGoalSelector.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PathfinderGoalSelector.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java index 90350e29..28c21aad 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java @@ -6,10 +6,9 @@ import org.bukkit.craftbukkit.util.UnsafeList; // CraftBukkit public class PathfinderGoalSelector { - // CraftBukkit start - use UnsafeList, add boolean for picking goals + // CraftBukkit start - use UnsafeList private UnsafeList a = new UnsafeList(16); private UnsafeList b = new UnsafeList(16); - boolean oddCall = true; // CraftBukkit end public PathfinderGoalSelector() {} @@ -21,8 +20,7 @@ public class PathfinderGoalSelector { public void a() { //ArrayList arraylist = new ArrayList(); // CraftBukkit - removed usage - // CraftBukkit start - don't use iterators for private fields, only run every other call - if (oddCall) { + // CraftBukkit start - don't use iterators for private fields for (int i = 0; i < this.a.size(); i++) { PathfinderGoalSelectorItem pathfindergoalselectoritem = (PathfinderGoalSelectorItem) this.a.unsafeGet(i); // CraftBukkit - use unsafeGet boolean flag = this.b.contains(pathfindergoalselectoritem); @@ -44,8 +42,6 @@ public class PathfinderGoalSelector { this.b.add(pathfindergoalselectoritem); } } - } - oddCall = !oddCall; // CraftBukkit end boolean flag1 = false; |