Workbench now drops the cell inside it if broken.
This commit is contained in:
parent
72219780ef
commit
1ae63261ed
1 changed files with 15 additions and 0 deletions
|
@ -1,8 +1,11 @@
|
|||
package appeng.tile.misc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.storage.ICellWorkbenchItem;
|
||||
|
@ -165,6 +168,18 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(World w, int x, int y, int z, ArrayList<ItemStack> drops)
|
||||
{
|
||||
super.getDrops( w, x, y, z, drops );
|
||||
|
||||
if ( cell.getStackInSlot( 0 ) != null )
|
||||
{
|
||||
drops.add( cell.getStackInSlot( 0 ) );
|
||||
cell.setInventorySlotContents( 0, null );
|
||||
}
|
||||
}
|
||||
|
||||
public ICellWorkbenchItem getCell()
|
||||
{
|
||||
if ( cell.getStackInSlot( 0 ) == null )
|
||||
|
|
Loading…
Reference in a new issue