GT5-Unofficial/src/main/java/gregtech/api/gui/GT_Slot_Render.java

22 lines
779 B
Java
Raw Normal View History

2015-04-23 18:14:22 +02:00
package gregtech.api.gui;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class GT_Slot_Render extends GT_Slot_Holo {
2015-10-21 22:06:25 -04:00
public GT_Slot_Render(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4, false, false, 0);
}
/**
* NEI has a nice and "useful" Delete-All Function, which would delete the Content of this Slot. This is here to prevent that.
*/
2015-04-23 18:14:22 +02:00
@Override
2015-10-21 22:06:25 -04:00
public void putStack(ItemStack aStack) {
if (inventory instanceof TileEntity && ((TileEntity) inventory).getWorldObj().isRemote) {
2015-04-23 18:14:22 +02:00
inventory.setInventorySlotContents(getSlotIndex(), aStack);
2015-10-21 22:06:25 -04:00
}
2015-04-23 18:14:22 +02:00
onSlotChanged();
}
}