From 1abb89c5127d87fc12c25ff3fd358591f654e534 Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Sun, 27 Aug 2017 21:12:18 -0400 Subject: [PATCH] Closes #911 --- .../mod/blocks/BlockGreenhouseGlass.java | 1 + .../mod/items/ItemChestToCrateUpgrade.java | 12 ++++-------- .../actuallyadditions/mod/util/AwfulUtil.java | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java index ce60c1571..5c2f42cfb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java @@ -43,6 +43,7 @@ public class BlockGreenhouseGlass extends BlockContainerBase{ } @Override + @Deprecated @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side){ IBlockState otherState = world.getBlockState(pos.offset(side)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java index 75eae49df..4affc7e8f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java @@ -60,9 +60,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{ ItemStack[] stacks = new ItemStack[chest.getSlots()]; for(int i = 0; i < stacks.length; i++){ ItemStack aStack = chest.getStackInSlot(i); - if(StackUtil.isValid(aStack)){ stacks[i] = aStack.copy(); - } } //Set New Block @@ -70,6 +68,8 @@ public class ItemChestToCrateUpgrade extends ItemBase{ world.removeTileEntity(pos); world.setBlockState(pos, this.end, 2); + if(!player.capabilities.isCreativeMode) + heldStack.shrink(1); //Copy Items into new Chest TileEntity newTileHit = world.getTileEntity(pos); @@ -84,17 +84,13 @@ public class ItemChestToCrateUpgrade extends ItemBase{ } } } - - if(!player.capabilities.isCreativeMode){ - player.setHeldItem(hand, StackUtil.addStackSize(heldStack, -1)); - } } } - return world.isRemote ? EnumActionResult.PASS : EnumActionResult.SUCCESS; + return EnumActionResult.SUCCESS; } } - return super.onItemUseFirst(player, world, pos, side, hitX, hitY, hitZ, hand); + return EnumActionResult.PASS; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AwfulUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AwfulUtil.java index 479fc4278..0f43622ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AwfulUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AwfulUtil.java @@ -101,7 +101,7 @@ public final class AwfulUtil{ int i = 0; String error = "Actually Additions: Something is incredibly wrong. I don't know what you did, or how this method got called. But something is just completely wrong. This method was provided with "; for(Object k : stuff) { - error += ("\n" + i++ + ":" + (k == null ? "null" : (k.getClass() + "<- CLASS | INSTANCE ->" + k.toString() + ", "))); + error += ("\n" + i++ + ": " + (k == null ? "null" : (k.getClass().getSimpleName() + " <- CLASS | INSTANCE -> " + k.toString() + ", "))); } error += "\n" + "The current side is: " + FMLCommonHandler.instance().getEffectiveSide(); throw new IllegalStateException(error);