summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemArmor.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/ItemArmor.patch')
-rw-r--r--nms-patches/ItemArmor.patch21
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) {