Paper/nms-patches/PathfinderGoalSelector.patch
Thinkofdeath 24557bc2b3 Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
2014-11-28 17:16:30 +11:00

33 Zeilen
1.6 KiB
Diff

--- ../work/decompile-bb26c12b/net/minecraft/server/PathfinderGoalSelector.java 2014-11-27 08:59:46.837421248 +1100
+++ src/main/java/net/minecraft/server/PathfinderGoalSelector.java 2014-11-27 08:42:10.164850887 +1100
@@ -6,11 +6,15 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.bukkit.craftbukkit.util.UnsafeList; // CraftBukkit
+
public class PathfinderGoalSelector {
private static final Logger a = LogManager.getLogger();
- private List b = Lists.newArrayList();
- private List c = Lists.newArrayList();
+ // CraftBukkit start - ArrayList -> UnsafeList
+ private List b = new UnsafeList();
+ private List c = new UnsafeList();
+ // CraftBukkit end
private final MethodProfiler d;
private int e;
private int f = 3;
@@ -107,9 +111,11 @@
if (pathfindergoalselectoritem1 != pathfindergoalselectoritem) {
if (pathfindergoalselectoritem.b >= pathfindergoalselectoritem1.b) {
if (!this.a(pathfindergoalselectoritem, pathfindergoalselectoritem1) && this.c.contains(pathfindergoalselectoritem1)) {
+ ((UnsafeList.Itr) iterator).valid = false; // CraftBukkit - mark iterator for reuse
return false;
}
} else if (!pathfindergoalselectoritem1.a.i() && this.c.contains(pathfindergoalselectoritem1)) {
+ ((UnsafeList.Itr) iterator).valid = false; // CraftBukkit - mark iterator for reuse
return false;
}
}