assemblyline/src/main/java/assemblyline/common/machine/imprinter/SlotImprintResult.java

27 lines
939 B
Java
Raw Normal View History

2022-10-26 19:42:44 +02:00
package assemblyline.common.machine.imprinter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
2023-02-10 17:51:10 +01:00
public class SlotImprintResult extends Slot {
2022-10-26 19:42:44 +02:00
public SlotImprintResult(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack par1ItemStack) {
return false;
}
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) {
super.onPickupFromSlot(par1EntityPlayer, par2ItemStack);
if (this.inventory.getStackInSlot(0) != null) {
2023-02-10 17:51:10 +01:00
--this.inventory.getStackInSlot((int) 0).stackSize;
if (this.inventory.getStackInSlot((int) 0).stackSize <= 0) {
2022-10-26 19:42:44 +02:00
this.inventory.setInventorySlotContents(0, null);
}
}
}
}