summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorFearThe1337 <admin@fearthe1337.com>2014-12-21 17:30:42 +0100
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-21 17:36:23 +0000
commitb6634d740973585499850325aa1288c17057f73e (patch)
tree6d449b1339e9bf6e1abd4d80945c9364eed76596 /nms-patches
parent2681166072054b7f6a0aaa66db4df2644f460271 (diff)
downloadcraftbukkit-b6634d740973585499850325aa1288c17057f73e.tar
craftbukkit-b6634d740973585499850325aa1288c17057f73e.tar.gz
craftbukkit-b6634d740973585499850325aa1288c17057f73e.tar.lz
craftbukkit-b6634d740973585499850325aa1288c17057f73e.tar.xz
craftbukkit-b6634d740973585499850325aa1288c17057f73e.zip
SPIGOT-241 - Fix the duplication glitch of Leads (Vanilla bug).
Glitch is caused because entities drop their leads when they are dead and still leashed and when they can't find their owner (Or the distance is too large). We need to make sure the entity we set to be dead, loses its leash before the next tick, else there will be two dropped leads.
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/Entity.patch16
1 files changed, 10 insertions, 6 deletions
diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch
index 4356df00..478fbbbb 100644
--- a/nms-patches/Entity.patch
+++ b/nms-patches/Entity.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde/net/minecraft/server/Entity.java 2014-12-12 11:04:49.470792233 +1100
-+++ src/main/java/net/minecraft/server/Entity.java 2014-12-12 11:03:57.000000000 +1100
+--- ../work/decompile-8eb82bde//net/minecraft/server/Entity.java Sun Dec 21 17:29:15 2014
++++ src/main/java/net/minecraft/server/Entity.java Sun Dec 21 17:29:15 2014
@@ -6,8 +6,40 @@
import java.util.UUID;
import java.util.concurrent.Callable;
@@ -331,12 +331,12 @@
+ }
+ }
+ // CraftBukkit end
-+
+
+ // CraftBukkit start - Reset world
+ if (this instanceof EntityPlayer) {
+ Server server = Bukkit.getServer();
+ org.bukkit.World bworld = null;
-
++
+ // TODO: Remove World related checks, replaced with WorldUID
+ String worldName = nbttagcompound.getString("world");
+
@@ -500,7 +500,7 @@
}
}
-@@ -1546,32 +1861,78 @@
+@@ -1546,32 +1861,82 @@
if (!this.world.isStatic && !this.dead) {
this.world.methodProfiler.a("changeDimension");
MinecraftServer minecraftserver = MinecraftServer.getServer();
@@ -580,11 +580,15 @@
+ // CraftBukkit start - Forward the CraftEntity to the new entity
+ this.getBukkitEntity().setHandle(entity);
+ entity.bukkitEntity = this.getBukkitEntity();
++
++ if (this instanceof EntityInsentient) {
++ ((EntityInsentient)this).unleash(true, false); // Unleash to prevent duping of leads.
++ }
+ // CraftBukkit end
}
this.dead = true;
-@@ -1680,8 +2041,27 @@
+@@ -1680,8 +2045,27 @@
return this.boundingBox;
}