Add canOpenGui to IChiselItem

This commit is contained in:
tterrag1098 committed 2015-01-14 21:11:33 -05:00
1 parent 7cf946e377
commit 38f78df16d
3 files changed
+20 -1

No files matched your search

@@ -77,7 +77,7 @@ public final class ChiselController {
break;
case RIGHT_CLICK_AIR:
case RIGHT_CLICK_BLOCK:
if (!event.world.isRemote) {
if (!event.world.isRemote && chisel.canOpenGui(event.world, event.entityPlayer, held)) {
event.entityPlayer.openGui(Chisel.instance, 0, event.world, 0, 0, 0);
}
break;
@@ -82,6 +82,11 @@ public class ItemChisel extends Item implements IChiselItem {
public ChiselMode getChiselMode(ItemStack itemStack) {
return ChiselMode.SINGLE;
}
@Override
public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel) {
return true;
}
@Override
public void onChisel(World world, IInventory inv, int slot, ItemStack chisel, ItemStack target) {