2013-12-28 15:03:20 -06:00
|
|
|
package appeng.container.implementations;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-01-26 22:00:36 -06:00
|
|
|
import appeng.api.config.SecurityPermissions;
|
2014-07-04 20:59:50 -05:00
|
|
|
import appeng.api.config.Settings;
|
|
|
|
import appeng.api.config.YesNo;
|
|
|
|
import appeng.api.util.IConfigManager;
|
|
|
|
import appeng.container.guisync.GuiSync;
|
2013-12-28 15:03:20 -06: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 02:44:52 -06:00
|
|
|
import appeng.helpers.DualityInterface;
|
|
|
|
import appeng.helpers.IInterfaceHost;
|
2013-12-28 15:03:20 -06:00
|
|
|
|
2014-07-04 20:59:50 -05:00
|
|
|
public class ContainerInterface extends ContainerUpgradeable
|
2013-12-28 15:03:20 -06:00
|
|
|
{
|
|
|
|
|
2014-07-04 20:59:50 -05:00
|
|
|
DualityInterface myDuality;
|
|
|
|
|
|
|
|
@GuiSync(3)
|
|
|
|
public YesNo bMode = YesNo.NO;
|
2013-12-28 15:03:20 -06:00
|
|
|
|
2014-01-05 02:44:52 -06:00
|
|
|
public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) {
|
2014-07-04 20:59:50 -05:00
|
|
|
super( ip, te.getInterfaceDuality().getHost() );
|
|
|
|
|
|
|
|
myDuality = te.getInterfaceDuality();
|
2013-12-28 15:03:20 -06:00
|
|
|
|
2014-04-22 20:36:07 -05:00
|
|
|
for (int x = 0; x < 9; x++)
|
2014-07-12 20:03:17 -05:00
|
|
|
addSlotToContainer( new SlotRestrictedInput( PlaceableItemType.ENCODED_PATTERN, myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, invPlayer ) );
|
2014-04-22 20:36:07 -05:00
|
|
|
|
2013-12-28 15:03:20 -06:00
|
|
|
for (int x = 0; x < 8; x++)
|
2014-07-04 20:59:50 -05:00
|
|
|
addSlotToContainer( new SlotFake( myDuality.getConfig(), x, 17 + 18 * x, 35 ) );
|
2013-12-28 15:03:20 -06:00
|
|
|
|
|
|
|
for (int x = 0; x < 8; x++)
|
2014-07-04 20:59:50 -05:00
|
|
|
addSlotToContainer( new SlotNormal( myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected int getHeight()
|
|
|
|
{
|
|
|
|
return 211;
|
|
|
|
}
|
2013-12-28 15:03:20 -06:00
|
|
|
|
2014-07-04 20:59:50 -05: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 15:03:20 -06:00
|
|
|
}
|
|
|
|
|
2014-01-26 22:00:36 -06:00
|
|
|
@Override
|
|
|
|
public void detectAndSendChanges()
|
|
|
|
{
|
|
|
|
verifyPermissions( SecurityPermissions.BUILD, false );
|
|
|
|
super.detectAndSendChanges();
|
|
|
|
}
|
2013-12-28 15:03:20 -06:00
|
|
|
}
|