From d1f1fb6552becafd9b26df2096db6317b46f62a7 Mon Sep 17 00:00:00 2001 From: TheCricket Date: Sun, 2 Nov 2014 16:44:01 -0500 Subject: [PATCH] Fixes #4 --- .../tileentity/TileEntityAutoChisel.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java index 3e8d34c1..460e07df 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java @@ -4,6 +4,8 @@ import info.jbcs.minecraft.chisel.carving.Carving; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -80,19 +82,21 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{ if (input != null && target != null) { - if (carving.getGroup(Block.getBlockFromItem(input.getItem()), input.getItemDamage()) == carving.getGroup(Block.getBlockFromItem(target.getItem()), target.getItemDamage())) { - equal = true; - } + if(input.getItem() instanceof ItemBlock && target.getItem() instanceof ItemBlock){ + if (carving.getGroup(Block.getBlockFromItem(input.getItem()), input.getItemDamage()) == carving.getGroup(Block.getBlockFromItem(target.getItem()), target.getItemDamage())) { + equal = true; + } - if (equal) { - if (output == null) { - setInventorySlotContents(2, new ItemStack(Block.getBlockFromItem(target.getItem()), 1, target.getItemDamage())); - } else { - if (input.stackSize != 0 || output.stackSize < getInventoryStackLimit()) { - decrStackSize(0, 1); - output.stackSize++; + if (equal) { + if (output == null) { + setInventorySlotContents(2, new ItemStack(Block.getBlockFromItem(target.getItem()), 1, target.getItemDamage())); } else { - inventory[0] = null; + if (input.stackSize != 0 || output.stackSize < getInventoryStackLimit()) { + decrStackSize(0, 1); + output.stackSize++; + } else { + inventory[0] = null; + } } } }