Applied-Energistics-2-tiler.../src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java

29 lines
652 B
Java
Raw Normal View History

2014-01-20 17:41:37 +01:00
package appeng.container.slot;
import net.minecraft.entity.player.InventoryPlayer;
2014-01-20 17:41:37 +01:00
import net.minecraft.inventory.IInventory;
public class OptionalSlotRestrictedInput extends SlotRestrictedInput
{
final int groupNum;
final IOptionalSlotHost host;
2014-01-20 17:41:37 +01:00
public OptionalSlotRestrictedInput(PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum,
InventoryPlayer invPlayer) {
super( valid, i, slotIndex, x, y, invPlayer );
2014-01-20 17:41:37 +01:00
this.groupNum = grpNum;
this.host = host;
}
@Override
public boolean isEnabled()
{
if ( host == null )
return false;
return host.isSlotEnabled( groupNum );
}
}