This commit is contained in:
Stuart Pomeroy 2016-03-29 09:58:07 +01:00
parent 43aca4d3f4
commit faa6aa30d0
2 changed files with 8 additions and 2 deletions

View file

@ -26,7 +26,7 @@ import techreborn.blocks.storage.BlockBatBox;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.items.ItemTR; import techreborn.items.ItemTR;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.storage.TileBatBox; import techreborn.tiles.storage.TileEnergyStorage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -60,7 +60,7 @@ public class ItemWrench extends ItemTR implements ITexturedItem
if (!player.isSneaking()) if (!player.isSneaking())
{ {
if (tile instanceof TileBatBox) if (tile instanceof TileEnergyStorage)
{ {
tile.getWorld().setBlockState(tile.getPos(), tile.getWorld().setBlockState(tile.getPos(),
tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite())); tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite()));

View file

@ -65,6 +65,9 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
if (inventory.getStackInSlot(0) != null) if (inventory.getStackInSlot(0) != null)
{ {
ItemStack stack = inventory.getStackInSlot(0); ItemStack stack = inventory.getStackInSlot(0);
if(!(stack.getItem() instanceof IEnergyItemInfo)){
return;
}
IEnergyItemInfo item = (IEnergyItemInfo) inventory.getStackInSlot(0).getItem(); IEnergyItemInfo item = (IEnergyItemInfo) inventory.getStackInSlot(0).getItem();
if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack)) if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack))
{ {
@ -78,6 +81,9 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
if (inventory.getStackInSlot(1) != null) if (inventory.getStackInSlot(1) != null)
{ {
ItemStack stack = inventory.getStackInSlot(1); ItemStack stack = inventory.getStackInSlot(1);
if(!(stack.getItem() instanceof IEnergyItemInfo)){
return;
}
IEnergyItemInfo item = (IEnergyItemInfo) stack.getItem(); IEnergyItemInfo item = (IEnergyItemInfo) stack.getItem();
if (item.canProvideEnergy(stack)) if (item.canProvideEnergy(stack))
{ {