From 40be9c84032216b4e1f4d078a2129c370d5e161f Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Tue, 24 Apr 2012 22:18:27 -0500 Subject: [PATCH] Optimized a little too much. Update goals every tick again to avoid AI oddness. --- .../java/net/minecraft/server/PathfinderGoalSelector.java | 8 ++------ 1 file 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 90350e29f0..28c21aad0b 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;