added option for item to go to player
This commit is contained in:
parent
20d38222bb
commit
14ce020223
1 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue