parent
43aca4d3f4
commit
faa6aa30d0
2 changed files with 8 additions and 2 deletions
|
@ -26,7 +26,7 @@ import techreborn.blocks.storage.BlockBatBox;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.items.ItemTR;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
import techreborn.tiles.storage.TileEnergyStorage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -60,7 +60,7 @@ public class ItemWrench extends ItemTR implements ITexturedItem
|
|||
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
if (tile instanceof TileBatBox)
|
||||
if (tile instanceof TileEnergyStorage)
|
||||
{
|
||||
tile.getWorld().setBlockState(tile.getPos(),
|
||||
tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite()));
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue