diff options
author | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
commit | c25ddf063a808e3adb749e22017661f403c5fb7e (patch) | |
tree | b2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/ItemArmor.patch | |
parent | 51263e97187a84338f89698eef187284055a682a (diff) | |
download | craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip |
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/ItemArmor.patch')
-rw-r--r-- | nms-patches/ItemArmor.patch | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/nms-patches/ItemArmor.patch b/nms-patches/ItemArmor.patch index ad7f06ea..61627ea6 100644 --- a/nms-patches/ItemArmor.patch +++ b/nms-patches/ItemArmor.patch @@ -12,13 +12,11 @@ public class ItemArmor extends Item { private static final int[] n = new int[] { 13, 15, 16, 11}; -@@ -32,7 +37,33 @@ - } else { +@@ -33,6 +38,32 @@ EntityLiving entityliving = (EntityLiving) list.get(0); EnumItemSlot enumitemslot = EntityInsentient.d(itemstack); -- ItemStack itemstack1 = itemstack.cloneItemStack(); + ItemStack itemstack1 = itemstack.cloneAndSubtract(1); + // CraftBukkit start -+ ItemStack itemstack1 = itemstack.cloneAndSubtract(1); + World world = isourceblock.getWorld(); + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); @@ -29,12 +27,12 @@ + } + + if (event.isCancelled()) { -+ itemstack.count++; ++ itemstack.add(1); + return itemstack; + } + + if (!event.getItem().equals(craftItem)) { -+ itemstack.count++; ++ itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); @@ -45,14 +43,5 @@ + } + // CraftBukkit end - itemstack1.count = 1; entityliving.setSlot(enumitemslot, itemstack1); -@@ -40,7 +71,7 @@ - ((EntityInsentient) entityliving).a(enumitemslot, 2.0F); - } - -- --itemstack.count; -+ // --itemstack.count; // CraftBukkit - handled above - return itemstack; - } - } + if (entityliving instanceof EntityInsentient) { |