mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-13 00:37:42 +00:00
All devs and contributors should use the provided formatter settings. If your IDE does not support the format, the rules are simple, it is the default java formatting rules, with 200char line lengths and 1 extra line after class definitions.
41 lines
902 B
Java
41 lines
902 B
Java
package com.cricketcraft.chisel.inventory;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.inventory.Slot;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
public class SlotChiselInput extends Slot {
|
|
|
|
public SlotChiselInput(ContainerChisel container, InventoryChiselSelection inv, int i, int j, int k) {
|
|
super(inv, i, j, k);
|
|
selInventory = inv;
|
|
this.container = container;
|
|
}
|
|
|
|
@Override
|
|
public boolean isItemValid(ItemStack itemstack) {
|
|
if (container.finished)
|
|
return false;
|
|
|
|
return super.isItemValid(itemstack);
|
|
}
|
|
|
|
@Override
|
|
public boolean canTakeStack(EntityPlayer par1EntityPlayer) {
|
|
return !container.finished && super.canTakeStack(par1EntityPlayer);
|
|
|
|
}
|
|
|
|
@Override
|
|
public void onSlotChanged() {
|
|
if (container.finished)
|
|
return;
|
|
|
|
super.onSlotChanged();
|
|
selInventory.updateItems();
|
|
}
|
|
|
|
ContainerChisel container;
|
|
InventoryChiselSelection selInventory;
|
|
}
|