diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch index c50e02732..23a7bb576 100644 --- a/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch +++ b/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch @@ -14,20 +14,21 @@ public class EntityLeash extends EntityHanging { public static final double OFFSET_Y = 0.375D; -@@ -89,6 +96,12 @@ +@@ -89,6 +96,13 @@ EntityInsentient entityinsentient = (EntityInsentient) iterator.next(); if (entityinsentient.getLeashHolder() == entityhuman) { + // CraftBukkit start + if (CraftEventFactory.callPlayerLeashEntityEvent(entityinsentient, this, entityhuman, enumhand).isCancelled()) { + ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutAttachEntity(entityinsentient, entityinsentient.getLeashHolder())); ++ flag = true; // Also set true when the event is cancelled otherwise it tries to unleash the entities + continue; + } + // CraftBukkit end entityinsentient.setLeashedTo(this, true); flag = true; } -@@ -97,18 +110,32 @@ +@@ -97,18 +111,32 @@ boolean flag1 = false; if (!flag) {