fixed slot tongs rendering

This commit is contained in:
Mohammad-Ali Minaie
2018-09-21 23:25:16 -04:00
parent a45d502cc6
commit 6f5dd58fc5
2 changed files with 23 additions and 22 deletions

View File

@@ -283,7 +283,7 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing face, float hitx, float hity, float hitz)
{
if(!world.isRemote){
//if(!world.isRemote){
//if (hand.equals(player.swingingHand)) {
IBlockState state = world.getBlockState(pos);
Block block = world.getBlockState(pos).getBlock();
@@ -430,8 +430,8 @@ public class SlottedTongs extends Item implements IPickup, AnvilHandler{
}
}
return EnumActionResult.FAIL;
}
return EnumActionResult.FAIL;
//}
//return EnumActionResult.FAIL;
}
public ItemStack getItem(World world, BlockPos pos, IBlockState state, Block block)

View File

@@ -233,31 +233,32 @@ 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)) {
SlottedTongs tongs = (SlottedTongs) pItem.getItem();
ItemStack tongStack = tongs.getSlotList().get(0).copy();
if (pItem.getItem().equals(ModItems.slottedtongs)) {
if (tongStack.isEmpty()) {
if (!tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tile.getSlotStack(counter).copy();
tongs.setSlotList(tempStack);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
SlottedTongs tongs = (SlottedTongs) pItem.getItem();
ItemStack tongStack = tongs.getSlotList().get(0).copy();
if (!tongStack.isEmpty()) {
if (tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tongs.getSlotList().get(0).copy();
tile.setSlotStack(counter, tempStack);
tongs.setSlotList(ItemStack.EMPTY);
return true;
}
if (tongStack.isEmpty()) {
if (!tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tile.getSlotStack(counter).copy();
tongs.setSlotList(tempStack);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (!tongStack.isEmpty()) {
if (tile.getSlotStack(counter).isEmpty()) {
ItemStack tempStack = tongs.getSlotList().get(0).copy();
tile.setSlotStack(counter, tempStack);
tongs.setSlotList(ItemStack.EMPTY);
return true;
}
}
}
if (!world.isRemote) {
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
if (tile.getSlotStack(counter).getItem().equals(Items.DIAMOND)) {