summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityLeash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityLeash.patch')
-rw-r--r--nms-patches/EntityLeash.patch31
1 files changed, 14 insertions, 17 deletions
diff --git a/nms-patches/EntityLeash.patch b/nms-patches/EntityLeash.patch
index bea9f62f..c742be1c 100644
--- a/nms-patches/EntityLeash.patch
+++ b/nms-patches/EntityLeash.patch
@@ -8,20 +8,19 @@
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
-@@ -74,6 +76,12 @@
- while (iterator.hasNext()) {
- entityinsentient = (EntityInsentient) iterator.next();
- if (entityinsentient.isLeashed() && entityinsentient.getLeashHolder() == entityhuman) {
-+ // CraftBukkit start
-+ if (CraftEventFactory.callPlayerLeashEntityEvent(entityinsentient, this, entityhuman).isCancelled()) {
-+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(entityinsentient, entityinsentient.getLeashHolder()));
-+ continue;
-+ }
-+ // CraftBukkit end
- entityinsentient.setLeashHolder(this, true);
- flag = true;
- }
-@@ -81,8 +89,11 @@
+@@ -71,22 +73,42 @@
+ while (iterator.hasNext()) {
+ entityinsentient = (EntityInsentient) iterator.next();
+ if (entityinsentient.isLeashed() && entityinsentient.getLeashHolder() == entityhuman) {
++ // CraftBukkit start
++ if (CraftEventFactory.callPlayerLeashEntityEvent(entityinsentient, this, entityhuman).isCancelled()) {
++ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(entityinsentient, entityinsentient.getLeashHolder()));
++ continue;
++ }
++ // CraftBukkit end
+ entityinsentient.setLeashHolder(this, true);
+ flag = true;
+ }
}
if (!flag) {
@@ -32,10 +31,8 @@
+ boolean die = true;
+ // CraftBukkit end
+ if (true || entityhuman.abilities.canInstantlyBuild) { // CraftBukkit - Process for non-creative as well
- d0 = 7.0D;
- list = this.world.a(EntityInsentient.class, new AxisAlignedBB(this.locX - 7.0D, this.locY - 7.0D, this.locZ - 7.0D, this.locX + 7.0D, this.locY + 7.0D, this.locZ + 7.0D));
iterator = list.iterator();
-@@ -90,9 +101,20 @@
+
while (iterator.hasNext()) {
entityinsentient = (EntityInsentient) iterator.next();
if (entityinsentient.isLeashed() && entityinsentient.getLeashHolder() == this) {