From 1ae63261ed0e9e5316b9a11ed38103bad6dbaef5 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 6 Apr 2014 18:14:28 -0500 Subject: [PATCH] Workbench now drops the cell inside it if broken. --- tile/misc/TileCellWorkbench.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tile/misc/TileCellWorkbench.java b/tile/misc/TileCellWorkbench.java index 43f384bb..851c928f 100644 --- a/tile/misc/TileCellWorkbench.java +++ b/tile/misc/TileCellWorkbench.java @@ -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 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 )