tongs are functional but rendering is jacked

This commit is contained in:
Mohammad-Ali Minaie
2018-09-22 22:08:37 -04:00
parent a06c4ce4ba
commit b6c42230fe
3 changed files with 8 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider,
if (tile != null) {
if (hand.equals(player.getActiveHand())) {
ItemStack pItem = player.inventory.getCurrentItem().copy();
ItemStack pItem = player.inventory.getCurrentItem();
ItemStack fuelItem = tile.getSlotStack(0);
/***********************
@@ -160,9 +160,9 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider,
}
}
if (facing == EnumFacing.UP) {
doForgeInventoryManager(pItem, world, tile, pos, hitX, hitY, hitZ, state, player);
return true;
}
}
}

View File

@@ -236,7 +236,7 @@ public interface AnvilHandler {
static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
if (!world.isRemote) {
if (pItem.getItem().equals(ModItems.slottedtongs)) {
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
@@ -357,7 +357,7 @@ public interface AnvilHandler {
return true;
}
}
}
return false;
}

View File

@@ -111,22 +111,23 @@ public interface ForgeHandler {
}
static boolean doWork(ItemStack pItem, Integer counter, TileForge tile, World world, BlockPos pos, EntityPlayer player) {
if (pItem.getItem().equals(ModItems.slottedtongs)) {
IItemHandler inventory = (IItemHandlerModifiable) pItem.getCapability(ITEM_HANDLER, null);
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
ItemStack tongsStack = inventory.getStackInSlot(0).copy();
if (tongsStack.isEmpty()) {
if (!tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tile.getSlotStack(counter).copy();
tile.setSlotStack(counter, ItemStack.EMPTY);
inventory.insertItem(0, tempStack, false);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (!tongsStack.isEmpty()) {
if (tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tongsStack;
ItemStack tempStack = tongsStack.copy();
tile.setSlotStack(counter, tempStack);
inventory.extractItem(0, 1, false);
return true;