Fix wrench.

This commit is contained in:
Stuart Pomeroy 2016-03-29 10:01:18 +01:00
parent ad9f50110a
commit fbfd42427e

View file

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