added option for item to go to player

This commit is contained in:
DarkGuardsman 2013-12-04 13:53:16 -05:00
parent 20d38222bb
commit 14ce020223

View file

@ -93,7 +93,15 @@ public class BlockEnergyStorage extends BlockMachine
{
if (!world.isRemote)
{
ItemWorldHelper.dropItemStack(world, new Vector3(x, y, z), ItemBlockEnergyStorage.getWrenchedBatteryBox(world, new Vector3(x, y, z)), false);
ItemStack batBoxStack = ItemBlockEnergyStorage.getWrenchedBatteryBox(world, new Vector3(x, y, z));
if (entityPlayer.getHeldItem() == null)
{
entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, batBoxStack);
}
else
{
ItemWorldHelper.dropItemStack(world, new Vector3(x, y, z), batBoxStack, false);
}
world.setBlockToAir(x, y, z);
}
return true;