From 3727b119f23e3f775d55bdb5ee4e3775573f5afa Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Fri, 18 Mar 2016 21:37:58 -0500 Subject: [PATCH] Update upstream and rebuild patches --- Bukkit | 2 +- CraftBukkit | 2 +- .../Optimize-Navigation-Listener.patch | 20 ++--- Spigot-Server-Patches/mc-dev-imports.patch | 75 +++++++++++++++++++ 4 files changed, 85 insertions(+), 14 deletions(-) diff --git a/Bukkit b/Bukkit index 60289d346e..5a1a8ef5ad 160000 --- a/Bukkit +++ b/Bukkit @@ -1 +1 @@ -Subproject commit 60289d346ec1b74832965d470bfef515f936222b +Subproject commit 5a1a8ef5ad40aeeaab05232668d0a045c8ae38c3 diff --git a/CraftBukkit b/CraftBukkit index a12b1a4770..8269b99393 160000 --- a/CraftBukkit +++ b/CraftBukkit @@ -1 +1 @@ -Subproject commit a12b1a47706a53b06ca18ae4ae9f696ea5699f3a +Subproject commit 8269b993936262e845788843889007383a370484 diff --git a/Spigot-Server-Patches/Optimize-Navigation-Listener.patch b/Spigot-Server-Patches/Optimize-Navigation-Listener.patch index 4547752bcc..5b2d38a9bf 100644 --- a/Spigot-Server-Patches/Optimize-Navigation-Listener.patch +++ b/Spigot-Server-Patches/Optimize-Navigation-Listener.patch @@ -57,19 +57,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) { -@@ -0,0 +0,0 @@ public class NavigationListener implements IWorldAccess { - // NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]); - // NavigationAbstract[] anavigationabstract1 = anavigationabstract; - // int j = anavigationabstract.length; -+ // Spigot end + if (this.a(world, blockposition, iblockdata, iblockdata1)) { ++ /* // Paper start + NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]); + NavigationAbstract[] anavigationabstract1 = anavigationabstract; + int j = anavigationabstract.length; -- for (NavigationAbstract navigationabstract : this.b.keySet()) { -- // NavigationAbstract navigationabstract = anavigationabstract1[k]; -- // Spigot end -+ // Paper start -+ // DO NOT USE AN ITERATOR! This must be a for (;;) to avoid CME. -+ // This is perfectly safe, as additions are ok to be done in this iteration -+ // And Removals are queued instead of immediate. +- for (int k = 0; k < j; ++k) { +- NavigationAbstract navigationabstract = anavigationabstract1[k]; ++ */ + for (int k = 0; k < this.navigators.size(); ++k) { + NavigationAbstract navigationabstract = this.navigators.get(k); + // Paper end diff --git a/Spigot-Server-Patches/mc-dev-imports.patch b/Spigot-Server-Patches/mc-dev-imports.patch index 6ae63c5164..8962c92eb1 100644 --- a/Spigot-Server-Patches/mc-dev-imports.patch +++ b/Spigot-Server-Patches/mc-dev-imports.patch @@ -5183,6 +5183,81 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.b.getType(blockposition.down()).b(); + } +} +diff --git a/src/main/java/net/minecraft/server/NavigationListener.java b/src/main/java/net/minecraft/server/NavigationListener.java +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/NavigationListener.java +@@ -0,0 +0,0 @@ ++package net.minecraft.server; ++ ++import java.util.WeakHashMap; ++ ++public class NavigationListener implements IWorldAccess { ++ ++ private static final Object a = new Object(); ++ private final WeakHashMap b = new WeakHashMap(); ++ ++ public NavigationListener() {} ++ ++ public void a(NavigationAbstract navigationabstract) { ++ this.b.put(navigationabstract, NavigationListener.a); ++ } ++ ++ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) { ++ if (this.a(world, blockposition, iblockdata, iblockdata1)) { ++ NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]); ++ NavigationAbstract[] anavigationabstract1 = anavigationabstract; ++ int j = anavigationabstract.length; ++ ++ for (int k = 0; k < j; ++k) { ++ NavigationAbstract navigationabstract = anavigationabstract1[k]; ++ ++ if (navigationabstract != null && !navigationabstract.i()) { ++ PathEntity pathentity = navigationabstract.k(); ++ ++ if (pathentity != null && !pathentity.b() && pathentity.d() != 0) { ++ PathPoint pathpoint = navigationabstract.c.c(); ++ double d0 = blockposition.distanceSquared(((double) pathpoint.a + navigationabstract.a.locX) / 2.0D, ((double) pathpoint.b + navigationabstract.a.locY) / 2.0D, ((double) pathpoint.c + navigationabstract.a.locZ) / 2.0D); ++ int l = (pathentity.d() - pathentity.e()) * (pathentity.d() - pathentity.e()); ++ ++ if (d0 < (double) l) { ++ navigationabstract.j(); ++ } ++ } ++ } ++ } ++ ++ } ++ } ++ ++ protected boolean a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) { ++ AxisAlignedBB axisalignedbb = iblockdata.d(world, blockposition); ++ AxisAlignedBB axisalignedbb1 = iblockdata1.d(world, blockposition); ++ ++ return axisalignedbb != axisalignedbb1 && (axisalignedbb == null || !axisalignedbb.equals(axisalignedbb1)); ++ } ++ ++ public void a(BlockPosition blockposition) {} ++ ++ public void a(int i, int j, int k, int l, int i1, int j1) {} ++ ++ public void a(EntityHuman entityhuman, SoundEffect soundeffect, SoundCategory soundcategory, double d0, double d1, double d2, float f, float f1) {} ++ ++ public void a(int i, boolean flag, double d0, double d1, double d2, double d3, double d4, double d5, int... aint) {} ++ ++ public void a(Entity entity) {} ++ ++ public void b(Entity entity) {} ++ ++ public void a(SoundEffect soundeffect, BlockPosition blockposition) {} ++ ++ public void a(int i, BlockPosition blockposition, int j) {} ++ ++ public void a(EntityHuman entityhuman, int i, BlockPosition blockposition, int j) {} ++ ++ public void b(int i, BlockPosition blockposition, int j) {} ++} diff --git a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000