Archiviert
13
0

Update upstream and rebuild patches

Dieser Commit ist enthalten in:
Zach Brown 2016-03-18 21:37:58 -05:00
Ursprung de235263df
Commit c19e52a63f
4 geänderte Dateien mit 92 neuen und 21 gelöschten Zeilen

2
Bukkit

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

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

Datei anzeigen

@ -1,4 +1,4 @@
From 620e9058fe63c0f5eff7f4a44e168979a856af22 Mon Sep 17 00:00:00 2001 From 7c9c5611ad40131650fb248b824e5119349431fb Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com> From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 21:09:10 -0600 Date: Mon, 29 Feb 2016 21:09:10 -0600
Subject: [PATCH] mc-dev imports Subject: [PATCH] mc-dev imports
@ -5183,6 +5183,81 @@ index 0000000..2f4265a
+ return this.b.getType(blockposition.down()).b(); + 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 0000000..f82ea80
--- /dev/null
+++ b/src/main/java/net/minecraft/server/NavigationListener.java
@@ -0,0 +1,69 @@
+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 diff --git a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java
new file mode 100644 new file mode 100644
index 0000000..30ca225 index 0000000..30ca225
@ -5489,5 +5564,5 @@ index 0000000..2286c9e
+ } + }
+} +}
-- --
2.7.4 2.7.3

Datei anzeigen

@ -1,4 +1,4 @@
From 6b6ec7e713ac57a04dc7004e164eb3cd80d364ca Mon Sep 17 00:00:00 2001 From 918a65f485c1a865b3a38ecd4e5a879d5bf786aa Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Tue, 8 Mar 2016 19:13:54 -0500 Date: Tue, 8 Mar 2016 19:13:54 -0500
Subject: [PATCH] Optimize Navigation Listener Subject: [PATCH] Optimize Navigation Listener
@ -32,10 +32,10 @@ index 7d794b9..aa18f54 100644
protected abstract Pathfinder a(); protected abstract Pathfinder a();
diff --git a/src/main/java/net/minecraft/server/NavigationListener.java b/src/main/java/net/minecraft/server/NavigationListener.java diff --git a/src/main/java/net/minecraft/server/NavigationListener.java b/src/main/java/net/minecraft/server/NavigationListener.java
index 39a4032..3c277cb 100644 index f82ea80..aade479 100644
--- a/src/main/java/net/minecraft/server/NavigationListener.java --- a/src/main/java/net/minecraft/server/NavigationListener.java
+++ b/src/main/java/net/minecraft/server/NavigationListener.java +++ b/src/main/java/net/minecraft/server/NavigationListener.java
@@ -1,16 +1,19 @@ @@ -1,26 +1,32 @@
package net.minecraft.server; package net.minecraft.server;
+import java.util.ArrayList; // Paper +import java.util.ArrayList; // Paper
@ -57,26 +57,22 @@ index 39a4032..3c277cb 100644
} }
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) {
@@ -19,10 +22,15 @@ public class NavigationListener implements IWorldAccess { if (this.a(world, blockposition, iblockdata, iblockdata1)) {
// NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]); + /* // Paper start
// NavigationAbstract[] anavigationabstract1 = anavigationabstract; NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]);
// int j = anavigationabstract.length; NavigationAbstract[] anavigationabstract1 = anavigationabstract;
+ // Spigot end int j = anavigationabstract.length;
- for (NavigationAbstract navigationabstract : this.b.keySet()) { - for (int k = 0; k < j; ++k) {
- // NavigationAbstract navigationabstract = anavigationabstract1[k]; - 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 < this.navigators.size(); ++k) { + for (int k = 0; k < this.navigators.size(); ++k) {
+ NavigationAbstract navigationabstract = this.navigators.get(k); + NavigationAbstract navigationabstract = this.navigators.get(k);
+ // Paper end + // Paper end
if (navigationabstract != null && !navigationabstract.i()) { if (navigationabstract != null && !navigationabstract.i()) {
PathEntity pathentity = navigationabstract.k(); PathEntity pathentity = navigationabstract.k();
@@ -57,9 +65,21 @@ public class NavigationListener implements IWorldAccess { @@ -55,9 +61,21 @@ public class NavigationListener implements IWorldAccess {
public void a(int i, boolean flag, double d0, double d1, double d2, double d3, double d4, double d5, int... aint) {} public void a(int i, boolean flag, double d0, double d1, double d2, double d3, double d4, double d5, int... aint) {}
@ -101,5 +97,5 @@ index 39a4032..3c277cb 100644
public void a(SoundEffect soundeffect, BlockPosition blockposition) {} public void a(SoundEffect soundeffect, BlockPosition blockposition) {}
-- --
2.7.4 2.7.3