@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user