2014-01-20 17:41:37 +01:00
|
|
|
package appeng.container.slot;
|
|
|
|
|
2014-07-13 03:03:17 +02:00
|
|
|
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;
|
|
|
|
IOptionalSlotHost host;
|
|
|
|
|
2014-07-13 03:03:17 +02:00
|
|
|
public OptionalSlotRestrictedInput(PlaceableItemType valid, IInventory i, IOptionalSlotHost host, int slotnum, int x, int y, int grpNum,
|
|
|
|
InventoryPlayer invPlayer) {
|
|
|
|
super( valid, i, slotnum, 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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|