2013-12-28 22:03:20 +01:00
|
|
|
package appeng.container.implementations;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-01-27 05:00:36 +01:00
|
|
|
import appeng.api.config.SecurityPermissions;
|
2014-07-05 03:59:50 +02:00
|
|
|
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;
|
|
|
|
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
2014-01-05 09:44:52 +01:00
|
|
|
import appeng.helpers.DualityInterface;
|
|
|
|
import appeng.helpers.IInterfaceHost;
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2014-07-05 03:59:50 +02:00
|
|
|
public class ContainerInterface extends ContainerUpgradeable
|
2013-12-28 22:03:20 +01:00
|
|
|
{
|
|
|
|
|
2014-07-05 03:59:50 +02:00
|
|
|
DualityInterface myDuality;
|
|
|
|
|
|
|
|
@GuiSync(3)
|
|
|
|
public YesNo bMode = YesNo.NO;
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2014-01-05 09:44:52 +01:00
|
|
|
public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) {
|
2014-07-05 03:59:50 +02:00
|
|
|
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-07-05 03:59:50 +02:00
|
|
|
addSlotToContainer( new SlotRestrictedInput( PlaceableItemType.ENCODED_PATTERN, myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7 ) );
|
2014-04-23 03:36:07 +02:00
|
|
|
|
2013-12-28 22:03:20 +01:00
|
|
|
for (int x = 0; x < 8; x++)
|
2014-07-05 03:59:50 +02:00
|
|
|
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++)
|
2014-07-05 03:59:50 +02:00
|
|
|
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
|
|
|
|
2014-07-05 03:59:50 +02:00
|
|
|
@Override
|
|
|
|
protected void setupConfig()
|
|
|
|
{
|
|
|
|
setupUpgrades();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void loadSettingsFromHost(IConfigManager cm)
|
|
|
|
{
|
|
|
|
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
|
|
|
|
}
|
|
|
|
|
|
|
|
public int availableUpgrades()
|
|
|
|
{
|
|
|
|
return 1;
|
2013-12-28 22:03:20 +01:00
|
|
|
}
|
|
|
|
|
2014-01-27 05:00:36 +01:00
|
|
|
@Override
|
|
|
|
public void detectAndSendChanges()
|
|
|
|
{
|
|
|
|
verifyPermissions( SecurityPermissions.BUILD, false );
|
|
|
|
super.detectAndSendChanges();
|
|
|
|
}
|
2013-12-28 22:03:20 +01:00
|
|
|
}
|