Update upstream and rebuild patches

This commit is contained in:
Zach Brown 2016-03-18 21:37:58 -05:00
parent 9571a3df27
commit 3727b119f2
4 changed files with 85 additions and 14 deletions

2
Bukkit

@ -1 +1 @@
Subproject commit 60289d346ec1b74832965d470bfef515f936222b
Subproject commit 5a1a8ef5ad40aeeaab05232668d0a045c8ae38c3

@ -1 +1 @@
Subproject commit a12b1a47706a53b06ca18ae4ae9f696ea5699f3a
Subproject commit 8269b993936262e845788843889007383a370484

View File

@ -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

View File

@ -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<NavigationAbstract, Object> 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