Applied-Energistics-2-tiler.../src/main/java/appeng/container/implementations/ContainerInterface.java

72 lines
1.8 KiB
Java
Raw Normal View History

2013-12-28 22:03:20 +01:00
package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings;
import appeng.api.config.YesNo;
import appeng.api.util.IConfigManager;
import appeng.container.guisync.GuiSync;
2013-12-28 22:03:20 +01:00
import appeng.container.slot.SlotFake;
import appeng.container.slot.SlotNormal;
import appeng.container.slot.SlotRestrictedInput;
2014-01-05 09:44:52 +01:00
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
2013-12-28 22:03:20 +01:00
public class ContainerInterface extends ContainerUpgradeable
2013-12-28 22:03:20 +01:00
{
DualityInterface myDuality;
@GuiSync(3)
public YesNo bMode = YesNo.NO;
2013-12-28 22:03:20 +01:00
@GuiSync(4)
public YesNo iTermMode = YesNo.YES;
2014-01-05 09:44:52 +01:00
public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) {
super( ip, te.getInterfaceDuality().getHost() );
myDuality = te.getInterfaceDuality();
2013-12-28 22:03:20 +01:00
2014-04-23 03:36:07 +02:00
for (int x = 0; x < 9; x++)
2014-09-21 02:38:51 +02:00
addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, invPlayer ) );
2014-04-23 03:36:07 +02:00
2013-12-28 22:03:20 +01:00
for (int x = 0; x < 8; x++)
addSlotToContainer( new SlotFake( myDuality.getConfig(), x, 17 + 18 * x, 35 ) );
2013-12-28 22:03:20 +01:00
for (int x = 0; x < 8; x++)
addSlotToContainer( new SlotNormal( myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) );
}
@Override
protected int getHeight()
{
return 211;
}
2013-12-28 22:03:20 +01:00
@Override
protected void setupConfig()
{
setupUpgrades();
}
protected void loadSettingsFromHost(IConfigManager cm)
{
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
}
public int availableUpgrades()
{
return 1;
2013-12-28 22:03:20 +01:00
}
@Override
public void detectAndSendChanges()
{
verifyPermissions( SecurityPermissions.BUILD, false );
super.detectAndSendChanges();
}
2013-12-28 22:03:20 +01:00
}