From d219213e2bb8b63e6ca51c1c86a7a698ac5106d3 Mon Sep 17 00:00:00 2001 From: Jacob Martin Date: Sat, 8 Apr 2017 18:05:32 -0500 Subject: [PATCH] Fixes to mob equipment behaviour * Set correct flag for CanPickUpLoot on NBT load * Drop previous equipment on mob equipment pickup --- nms-patches/EntityInsentient.patch | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/nms-patches/EntityInsentient.patch b/nms-patches/EntityInsentient.patch index 44801a840a..d76af694bf 100644 --- a/nms-patches/EntityInsentient.patch +++ b/nms-patches/EntityInsentient.patch @@ -75,7 +75,7 @@ - this.m(nbttagcompound.getBoolean("CanPickUpLoot")); + boolean data = nbttagcompound.getBoolean("CanPickUpLoot"); + if (isLevelAtLeast(nbttagcompound, 1) || data) { -+ this.l(data); ++ this.m(data); + } } @@ -88,7 +88,17 @@ NBTTagList nbttaglist; int i; -@@ -569,11 +621,11 @@ +@@ -521,7 +573,9 @@ + } + + if (!itemstack1.isEmpty() && (double) (this.random.nextFloat() - 0.1F) < d0) { ++ this.forceDrops = true; // CraftBukkit + this.a(itemstack1, 0.0F); ++ this.forceDrops = false; // CraftBukkit + } + + if (itemstack.getItem() == Items.DIAMOND && entityitem.n() != null) { +@@ -569,11 +623,11 @@ double d2 = entityhuman.locZ - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -102,7 +112,7 @@ this.die(); } else if (d3 < 1024.0D) { this.ticksFarFromPlayer = 0; -@@ -942,12 +994,24 @@ +@@ -942,12 +996,24 @@ public final boolean b(EntityHuman entityhuman, EnumHand enumhand) { if (this.isLeashed() && this.getLeashHolder() == entityhuman) { @@ -127,7 +137,7 @@ this.setLeashHolder(entityhuman, true); itemstack.subtract(1); return true; -@@ -968,10 +1032,12 @@ +@@ -968,10 +1034,12 @@ if (this.bD) { if (!this.isAlive()) { @@ -140,7 +150,7 @@ this.unleash(true, true); } } -@@ -982,7 +1048,9 @@ +@@ -982,7 +1050,9 @@ this.bD = false; this.leashHolder = null; if (!this.world.isClientSide && flag1) { @@ -150,7 +160,7 @@ } if (!this.world.isClientSide && flag && this.world instanceof WorldServer) { -@@ -1052,6 +1120,7 @@ +@@ -1052,6 +1122,7 @@ this.setLeashHolder(entityleash, true); } else {