Prevent item voiding in some transit systems when removing drawers from connected bank

This commit is contained in:
Justin Aquadro committed 2015-03-18 23:24:46 -04:00
1 parent 479f093757
commit ee7a4dd312
1 file changed
+13
@@ -8,6 +8,7 @@ import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroupInteractive
import com.jaquadro.minecraft.storagedrawers.network.ControllerUpdateMessage;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -249,6 +250,12 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS
if (!storage.containsKey(coord))
return null;
TileEntity te = worldObj.getTileEntity(coord.x, coord.y, coord.z);
if (!(te instanceof IDrawerGroup)) {
storage.remove(coord);
return null;
}
return storage.get(coord);
}
@@ -263,6 +270,12 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS
if (!storage.containsKey(coord))
return null;
TileEntity te = worldObj.getTileEntity(coord.x, coord.y, coord.z);
if (!(te instanceof IDrawerGroup)) {
storage.remove(coord);
return null;
}
return storage.get(coord);
}