2014-11-14 12:02:52 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Applied Energistics 2.
|
|
|
|
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
|
|
*/
|
|
|
|
|
2013-12-28 22:03:20 +01:00
|
|
|
package appeng.container.implementations;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2013-12-28 22:03:20 +01:00
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-12-29 21:59:05 +01:00
|
|
|
|
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;
|
2014-01-05 09:44:52 +01:00
|
|
|
import appeng.helpers.DualityInterface;
|
|
|
|
import appeng.helpers.IInterfaceHost;
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2014-07-05 03:59:50 +02:00
|
|
|
public class ContainerInterface extends ContainerUpgradeable
|
2013-12-28 22:03:20 +01:00
|
|
|
{
|
|
|
|
|
2014-09-29 09:54:34 +02:00
|
|
|
final DualityInterface myDuality;
|
2014-07-05 03:59:50 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
@GuiSync( 3 )
|
2014-07-05 03:59:50 +02:00
|
|
|
public YesNo bMode = YesNo.NO;
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
@GuiSync( 4 )
|
2014-07-31 04:02:37 +02:00
|
|
|
public YesNo iTermMode = YesNo.YES;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
public ContainerInterface( InventoryPlayer ip, IInterfaceHost te )
|
|
|
|
{
|
2014-07-05 03:59:50 +02:00
|
|
|
super( ip, te.getInterfaceDuality().getHost() );
|
|
|
|
|
2014-12-29 15:13:47 +01:00
|
|
|
this.myDuality = te.getInterfaceDuality();
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < 9; x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.invPlayer ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-04-23 03:36:07 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < 8; x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 17 + 18 * x, 35 ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2013-12-28 22:03:20 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( int x = 0; x < 8; x++ )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 17 + 18 * x, 35 + 18 ) );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2014-07-05 03:59:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@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()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.setupUpgrades();
|
2014-07-05 03:59:50 +02:00
|
|
|
}
|
|
|
|
|
2014-09-28 20:34:00 +02:00
|
|
|
@Override
|
2014-07-05 03:59:50 +02:00
|
|
|
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()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.verifyPermissions( SecurityPermissions.BUILD, false );
|
2014-01-27 05:00:36 +01:00
|
|
|
super.detectAndSendChanges();
|
|
|
|
}
|
2015-04-03 08:54:31 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void loadSettingsFromHost( IConfigManager cm )
|
|
|
|
{
|
|
|
|
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
|
|
|
|
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
|
|
|
|
}
|
2013-12-28 22:03:20 +01:00
|
|
|
}
|