Container-Stuff
This commit is contained in:
@@ -26,11 +26,13 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -38,7 +40,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
@@ -97,13 +98,14 @@ public abstract class AEBaseContainer extends Container
|
||||
private int ticksSinceCheck = 900;
|
||||
private IAEItemStack clientRequestedTargetItem = null;
|
||||
|
||||
public AEBaseContainer( final PlayerInventory ip, final TileEntity myTile, final IPart myPart )
|
||||
public AEBaseContainer( ContainerType<?> containerType, int id, final PlayerInventory ip, final TileEntity myTile, final IPart myPart )
|
||||
{
|
||||
this( ip, myTile, myPart, null );
|
||||
this( containerType, id, ip, myTile, myPart, null );
|
||||
}
|
||||
|
||||
public AEBaseContainer( final PlayerInventory ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio )
|
||||
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio )
|
||||
{
|
||||
super(containerType, id);
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = myTile;
|
||||
this.part = myPart;
|
||||
@@ -112,6 +114,24 @@ public abstract class AEBaseContainer extends Container
|
||||
this.prepareSync();
|
||||
}
|
||||
|
||||
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object anchor )
|
||||
{
|
||||
super(containerType, id);
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null;
|
||||
this.part = anchor instanceof IPart ? (IPart) anchor : null;
|
||||
this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null;
|
||||
|
||||
if( this.tileEntity == null && this.part == null && this.obj == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Must have a valid anchor, instead " + anchor + " in " + ip );
|
||||
}
|
||||
|
||||
this.mySrc = new PlayerSource( ip.player, this.getActionHost() );
|
||||
|
||||
this.prepareSync();
|
||||
}
|
||||
|
||||
protected IActionHost getActionHost()
|
||||
{
|
||||
if( this.obj instanceof IActionHost )
|
||||
@@ -151,23 +171,6 @@ public abstract class AEBaseContainer extends Container
|
||||
}
|
||||
}
|
||||
|
||||
public AEBaseContainer( final PlayerInventory ip, final Object anchor )
|
||||
{
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null;
|
||||
this.part = anchor instanceof IPart ? (IPart) anchor : null;
|
||||
this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null;
|
||||
|
||||
if( this.tileEntity == null && this.part == null && this.obj == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Must have a valid anchor, instead " + anchor + " in " + ip );
|
||||
}
|
||||
|
||||
this.mySrc = new PlayerSource( ip.player, this.getActionHost() );
|
||||
|
||||
this.prepareSync();
|
||||
}
|
||||
|
||||
public IAEItemStack getTargetStack()
|
||||
{
|
||||
return this.clientRequestedTargetItem;
|
||||
@@ -310,11 +313,11 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
if( this.locked.contains( j + i * 9 + 9 ) )
|
||||
{
|
||||
this.addSlotToContainer( new SlotDisabled( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) );
|
||||
this.addSlot( new SlotDisabled( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addSlotToContainer( new SlotPlayerInv( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) );
|
||||
this.addSlot( new SlotPlayerInv( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,23 +327,23 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
if( this.locked.contains( i ) )
|
||||
{
|
||||
this.addSlotToContainer( new SlotDisabled( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) );
|
||||
this.addSlot( new SlotDisabled( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addSlotToContainer( new SlotPlayerHotBar( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) );
|
||||
this.addSlot( new SlotPlayerHotBar( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Slot addSlotToContainer( final Slot newSlot )
|
||||
protected Slot addSlot(final Slot newSlot )
|
||||
{
|
||||
if( newSlot instanceof AppEngSlot )
|
||||
{
|
||||
final AppEngSlot s = (AppEngSlot) newSlot;
|
||||
s.setContainer( this );
|
||||
return super.addSlotToContainer( newSlot );
|
||||
return super.addSlot( newSlot );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -654,7 +657,7 @@ public abstract class AEBaseContainer extends Container
|
||||
return ( (AppEngSlot) s ).isDraggable();
|
||||
}
|
||||
|
||||
public void doAction( final PlayerEntityMP player, final InventoryAction action, final int slot, final long id )
|
||||
public void doAction( final ServerPlayerEntity player, final InventoryAction action, final int slot, final long id )
|
||||
{
|
||||
if( slot >= 0 && slot < this.inventorySlots.size() )
|
||||
{
|
||||
@@ -1012,7 +1015,7 @@ public abstract class AEBaseContainer extends Container
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateHeld( final PlayerEntityMP p )
|
||||
protected void updateHeld( final ServerPlayerEntity p )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -1099,7 +1102,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
NetworkHandler.instance()
|
||||
.sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ),
|
||||
(PlayerEntityMP) this.getPlayerInventory().player );
|
||||
(ServerPlayerEntity) this.getPlayerInventory().player );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -23,14 +23,13 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketProgressBar;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
|
||||
|
||||
public class SyncData
|
||||
@@ -86,9 +85,9 @@ public class SyncData
|
||||
{
|
||||
if( val instanceof String )
|
||||
{
|
||||
if( o instanceof PlayerEntityMP )
|
||||
if( o instanceof ServerPlayerEntity)
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (PlayerEntityMP) o );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (ServerPlayerEntity) o );
|
||||
}
|
||||
}
|
||||
else if( this.field.getType().isEnum() )
|
||||
@@ -97,9 +96,9 @@ public class SyncData
|
||||
}
|
||||
else if( val instanceof Long || val.getClass() == long.class )
|
||||
{
|
||||
if( o instanceof PlayerEntityMP )
|
||||
if( o instanceof ServerPlayerEntity )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (PlayerEntityMP) o );
|
||||
NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (ServerPlayerEntity) o );
|
||||
}
|
||||
}
|
||||
else if( val instanceof Boolean || val.getClass() == boolean.class )
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.container.implementations;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.CopyMode;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -94,7 +93,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
protected void setupConfig()
|
||||
{
|
||||
final IItemHandler cell = this.getUpgradeable().getInventoryByName( "cell" );
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getPlayerInv() ) );
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getPlayerInv() ) );
|
||||
|
||||
final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" );
|
||||
final WrapperSupplierItemHandler upgradeInventory = new WrapperSupplierItemHandler( this::getCellUpgradeInventory );
|
||||
@@ -107,7 +106,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
{
|
||||
for( int z = 0; z < 9; z++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) );
|
||||
this.addSlot( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) );
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +116,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
for( int z = 0; z < 8; z++ )
|
||||
{
|
||||
final int iSLot = zz * 8 + z;
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this
|
||||
.getPlayerInventory() ) );
|
||||
}
|
||||
@@ -164,9 +163,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
}
|
||||
|
||||
if( listener instanceof PlayerEntityMP )
|
||||
if( listener instanceof ServerPlayerEntity )
|
||||
{
|
||||
( (PlayerEntityMP) listener ).isChangingQuantityOnly = false;
|
||||
( (ServerPlayerEntity) listener ).isChangingQuantityOnly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ContainerChest extends AEBaseContainer
|
||||
super( ip, chest, null );
|
||||
this.chest = chest;
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest.getInternalInventory(), 1, 80, 37, this
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest.getInternalInventory(), 1, 80, 37, this
|
||||
.getPlayerInventory() ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 );
|
||||
|
||||
@@ -51,9 +51,9 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
|
||||
|
||||
IItemHandler inv = condenser.getInternalInventory();
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, inv, 0, 51, 52, ip ) );
|
||||
this.addSlotToContainer( new SlotOutput( inv, 1, 105, 52, -1 ) );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, inv, 0, 51, 52, ip ) );
|
||||
this.addSlot( new SlotOutput( inv, 1, 105, 52, -1 ) );
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, inv, 2, 101, 26, ip ) ).setStackLimit( 1 ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 );
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ContainerCraftAmount extends AEBaseContainer
|
||||
super( ip, te );
|
||||
|
||||
this.craftingItem = new SlotInaccessible( new AppEngInternalInventory( null, 1 ), 0, 34, 53 );
|
||||
this.addSlotToContainer( this.getCraftingItem() );
|
||||
this.addSlot( this.getCraftingItem() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -263,11 +263,11 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
{
|
||||
if( g instanceof PlayerEntity )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( a, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( b, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( a, (ServerPlayerEntity) g );
|
||||
NetworkHandler.instance().sendTo( b, (ServerPlayerEntity) g );
|
||||
if( c != null )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( c, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( c, (ServerPlayerEntity) g );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.container.implementations;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (ServerPlayerEntity) g );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -191,17 +191,17 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
{
|
||||
if( !a.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( a, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( a, (ServerPlayerEntity) g );
|
||||
}
|
||||
|
||||
if( !b.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( b, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( b, (ServerPlayerEntity) g );
|
||||
}
|
||||
|
||||
if( !c.isEmpty() )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( c, (PlayerEntityMP) g );
|
||||
NetworkHandler.instance().sendTo( c, (ServerPlayerEntity) g );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
|
||||
{
|
||||
for( int x = 0; x < 3; x++ )
|
||||
{
|
||||
this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) );
|
||||
this.addSlot( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) );
|
||||
}
|
||||
}
|
||||
|
||||
this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.getActionSource(), this
|
||||
this.addSlot( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.getActionSource(), this
|
||||
.getPowerSource(), monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 0 );
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ContainerDrive extends AEBaseContainer
|
||||
{
|
||||
for( int x = 0; x < 2; x++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive
|
||||
.getInternalInventory(), x + y * 2, 71 + x * 18, 14 + y * 18, this.getPlayerInventory() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,28 +65,28 @@ public class ContainerFormationPlane extends ContainerUpgradeable
|
||||
{
|
||||
if( y < 2 )
|
||||
{
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) );
|
||||
this.addSlot( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
|
||||
@@ -38,15 +38,15 @@ public class ContainerGrinder extends AEBaseContainer
|
||||
|
||||
IItemHandler inv = grinder.getInternalInventory();
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 0, 12, 17, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 1, 12 + 18, 17, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 2, 12 + 36, 17, this.getPlayerInventory() ) );
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 0, 12, 17, this.getPlayerInventory() ) );
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 1, 12 + 18, 17, this.getPlayerInventory() ) );
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 2, 12 + 36, 17, this.getPlayerInventory() ) );
|
||||
|
||||
this.addSlotToContainer( new SlotInaccessible( inv, 6, 80, 40 ) );
|
||||
this.addSlot( new SlotInaccessible( inv, 6, 80, 40 ) );
|
||||
|
||||
this.addSlotToContainer( new SlotOutput( inv, 3, 112, 63, 2 * 16 + 15 ) );
|
||||
this.addSlotToContainer( new SlotOutput( inv, 4, 112 + 18, 63, 2 * 16 + 15 ) );
|
||||
this.addSlotToContainer( new SlotOutput( inv, 5, 112 + 36, 63, 2 * 16 + 15 ) );
|
||||
this.addSlot( new SlotOutput( inv, 3, 112, 63, 2 * 16 + 15 ) );
|
||||
this.addSlot( new SlotOutput( inv, 4, 112 + 18, 63, 2 * 16 + 15 ) );
|
||||
this.addSlot( new SlotOutput( inv, 5, 112 + 36, 63, 2 * 16 + 15 ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 176 - /* height of player inventory */82 );
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
{
|
||||
for( int x = 0; x < 2; x++ )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this
|
||||
.getPlayerInventory() ) );
|
||||
}
|
||||
@@ -77,18 +77,18 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
{
|
||||
for( int x = 0; x < 2; x++ )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) );
|
||||
}
|
||||
}
|
||||
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.features.IInscriberRecipe;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
@@ -63,14 +62,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
|
||||
IItemHandler inv = te.getInternalInventory();
|
||||
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv, 0, 45, 16, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv, 1, 45, 62, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, inv, 2, 63, 39, this.getPlayerInventory() ) );
|
||||
|
||||
this.addSlotToContainer( new SlotOutput( inv, 3, 113, 40, -1 ) );
|
||||
this.addSlot( new SlotOutput( inv, 3, 113, 40, -1 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,18 +52,18 @@ public class ContainerInterface extends ContainerUpgradeable
|
||||
|
||||
for( int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality
|
||||
.getPatterns(), x, 8 + 18 * x, 90 + 7, this.getPlayerInventory() ) );
|
||||
}
|
||||
|
||||
for( int x = 0; x < DualityInterface.NUMBER_OF_CONFIG_SLOTS; x++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 8 + 18 * x, 35 ) );
|
||||
this.addSlot( new SlotFake( this.myDuality.getConfig(), x, 8 + 18 * x, 35 ) );
|
||||
}
|
||||
|
||||
for( int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18 ) );
|
||||
this.addSlot( new SlotNormal( this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -188,7 +188,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (PlayerEntityMP) this.getPlayerInv().player );
|
||||
NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (ServerPlayerEntity) this.getPlayerInv().player );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -200,7 +200,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAction( final PlayerEntityMP player, final InventoryAction action, final int slot, final long id )
|
||||
public void doAction( final ServerPlayerEntity player, final InventoryAction action, final int slot, final long id )
|
||||
{
|
||||
final InvTracker inv = this.byId.get( id );
|
||||
if( inv != null )
|
||||
|
||||
@@ -78,25 +78,25 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
if( this.availableUpgrades() > 0 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 1 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 2 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 3 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" );
|
||||
final int y = 40;
|
||||
final int x = 80 + 44;
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
this.addSlot( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -95,33 +95,33 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
for( int x = 0; x < 3; x++ )
|
||||
{
|
||||
final SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 );
|
||||
this.addSlotToContainer( s );
|
||||
this.addSlot( s );
|
||||
}
|
||||
}
|
||||
|
||||
offX = 126;
|
||||
offY = 16;
|
||||
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offX, offY, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer( new SlotOutput( mac, 9, offX, offY + 32, -1 ) );
|
||||
this.addSlot( new SlotOutput( mac, 9, offX, offY + 32, -1 ) );
|
||||
|
||||
offX = 122;
|
||||
offY = 17;
|
||||
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
|
||||
@@ -25,13 +25,12 @@ import java.nio.BufferOverflowException;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -169,7 +168,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
this.cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEW_CELL, ( (IViewCellStorage) monitorable )
|
||||
.getViewCellStorage(), y, 206, y * 18 + 8, this.getPlayerInventory() );
|
||||
this.cellView[y].setAllowEdit( this.canAccessViewCells );
|
||||
this.addSlotToContainer( this.cellView[y] );
|
||||
this.addSlot( this.cellView[y] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,11 +203,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
this.clientCM.putSetting( set, sideLocal );
|
||||
for( final IContainerListener crafter : this.listeners )
|
||||
{
|
||||
if( crafter instanceof PlayerEntityMP )
|
||||
if( crafter instanceof ServerPlayerEntity )
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (PlayerEntityMP) crafter );
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -249,7 +248,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
if( c instanceof PlayerEntity )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,14 +344,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
catch( final BufferOverflowException boe )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
|
||||
|
||||
piu = new PacketMEInventoryUpdate();
|
||||
piu.appendItem( send );
|
||||
}
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.container.implementations;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -138,7 +138,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
{
|
||||
if( c instanceof PlayerEntity )
|
||||
{
|
||||
NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c );
|
||||
NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
{
|
||||
for( int x = 0; x < 3; x++ )
|
||||
{
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te
|
||||
.getInventory(), y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, this.getPlayerInventory() ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.InventoryCraftResult;
|
||||
@@ -41,7 +41,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
@@ -104,25 +103,25 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
{
|
||||
for( int x = 0; x < 3; x++ )
|
||||
{
|
||||
this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) );
|
||||
this.addSlot( this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) );
|
||||
}
|
||||
}
|
||||
|
||||
this.addSlotToContainer( this.craftSlot = new SlotPatternTerm( ip.player, this.getActionSource(), this
|
||||
this.addSlot( this.craftSlot = new SlotPatternTerm( ip.player, this.getActionSource(), this
|
||||
.getPowerSource(), monitorable, this.crafting, patternInv, this.cOut, 110, -76 + 18, this, 2, this ) );
|
||||
this.craftSlot.setIIcon( -1 );
|
||||
|
||||
for( int y = 0; y < 3; y++ )
|
||||
{
|
||||
this.addSlotToContainer( this.outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) );
|
||||
this.addSlot( this.outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) );
|
||||
this.outputSlots[y].setRenderDisabled( false );
|
||||
this.outputSlots[y].setIIcon( -1 );
|
||||
}
|
||||
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.patternSlotIN = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BLANK_PATTERN, patternInv, 0, 147, -72 - 9, this
|
||||
.getPlayerInventory() ) );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.patternSlotOUT = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, patternInv, 1, 147, -72 + 34, this
|
||||
.getPlayerInventory() ) );
|
||||
|
||||
@@ -395,9 +394,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
if( extracted != null )
|
||||
{
|
||||
inv.addItems( extracted.createItemStack() );
|
||||
if( p instanceof PlayerEntityMP )
|
||||
if( p instanceof ServerPlayerEntity )
|
||||
{
|
||||
this.updateHeld( (PlayerEntityMP) p );
|
||||
this.updateHeld( (ServerPlayerEntity) p );
|
||||
}
|
||||
this.detectAndSendChanges();
|
||||
return;
|
||||
@@ -455,9 +454,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
inv.addItems( is );
|
||||
if( p instanceof PlayerEntityMP )
|
||||
if( p instanceof ServerPlayerEntity )
|
||||
{
|
||||
this.updateHeld( (PlayerEntityMP) p );
|
||||
this.updateHeld( (ServerPlayerEntity) p );
|
||||
}
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
@@ -519,9 +518,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
listener.sendSlotContents( this, slot.slotNumber, slot.getStack() );
|
||||
}
|
||||
}
|
||||
if( listener instanceof PlayerEntityMP )
|
||||
if( listener instanceof ServerPlayerEntity )
|
||||
{
|
||||
( (PlayerEntityMP) listener ).isChangingQuantityOnly = false;
|
||||
( (ServerPlayerEntity) listener ).isChangingQuantityOnly = false;
|
||||
}
|
||||
}
|
||||
this.detectAndSendChanges();
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ContainerQNB extends AEBaseContainer
|
||||
{
|
||||
super( ip, quantumBridge, null );
|
||||
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge
|
||||
.getInternalInventory(), 0, 80, 37, this.getPlayerInventory() ) ).setStackLimit( 1 ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 );
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
@@ -51,8 +50,8 @@ public class ContainerQuartzKnife extends AEBaseContainer
|
||||
super( ip, null, null );
|
||||
this.toolInv = te;
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) );
|
||||
this.addSlotToContainer( new QuartzKniveSlot( this.inSlot, 0, 134, 44, -1 ) );
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) );
|
||||
this.addSlot( new QuartzKniveSlot( this.inSlot, 0, 134, 44, -1 ) );
|
||||
|
||||
this.lockPlayerInventorySlot( ip.currentItem );
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.features.INetworkEncodable;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
@@ -60,12 +59,12 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements
|
||||
|
||||
this.securityBox = (TileSecurityStation) monitorable;
|
||||
|
||||
this.addSlotToContainer( this.configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox
|
||||
this.addSlot( this.configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox
|
||||
.getConfigSlot(), 0, 37, -33, ip ) );
|
||||
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
this.wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, this.wirelessEncoder, 0, 212, 10, ip ) );
|
||||
this.addSlotToContainer( this.wirelessOut = new SlotOutput( this.wirelessEncoder, 1, 212, 68, -1 ) );
|
||||
this.addSlot( this.wirelessOut = new SlotOutput( this.wirelessEncoder, 1, 212, 68, -1 ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 0 );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ContainerSkyChest extends AEBaseContainer
|
||||
{
|
||||
for( int x = 0; x < 9; x++ )
|
||||
{
|
||||
this.addSlotToContainer( new SlotNormal( this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y ) );
|
||||
this.addSlot( new SlotNormal( this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,9 +65,9 @@ public class ContainerSpatialIOPort extends AEBaseContainer
|
||||
this.network = spatialIOPort.getGridNode( AEPartLocation.INTERNAL ).getGrid();
|
||||
}
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort
|
||||
.getInternalInventory(), 0, 52, 48, this.getPlayerInventory() ) );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
new SlotOutput( spatialIOPort.getInternalInventory(), 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 );
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -82,28 +81,28 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
{
|
||||
if( y < 2 )
|
||||
{
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) );
|
||||
this.addSlot( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
{
|
||||
for( int u = 0; u < 3; u++ )
|
||||
{
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory
|
||||
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory
|
||||
.getInternalInventory(), u + v * 3, 186 + u * 18, this.getHeight() - 82 + v * 18, this.getPlayerInventory() ) ).setPlayerSide() );
|
||||
}
|
||||
}
|
||||
@@ -141,19 +141,19 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" );
|
||||
final int y = 40;
|
||||
final int x = 80;
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
this.addSlot( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
|
||||
if( this.supportCapacity() )
|
||||
{
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) );
|
||||
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) );
|
||||
this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) );
|
||||
this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,25 +162,25 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
|
||||
if( this.availableUpgrades() > 0 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 1 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 2 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
if( this.availableUpgrades() > 3 )
|
||||
{
|
||||
this.addSlotToContainer(
|
||||
this.addSlot(
|
||||
( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) )
|
||||
.setNotDraggable() );
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr
|
||||
super( ip, vibrationChamber, null );
|
||||
this.vibrationChamber = vibrationChamber;
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber.getInternalInventory(), 0, 80, 37, this
|
||||
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber.getInternalInventory(), 0, 80, 37, this
|
||||
.getPlayerInventory() ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 );
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ContainerWireless extends AEBaseContainer
|
||||
super( ip, te, null );
|
||||
this.wirelessTerminal = te;
|
||||
|
||||
this.addSlotToContainer( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal
|
||||
this.addSlot( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal
|
||||
.getInternalInventory(), 0, 80, 47, this.getPlayerInventory() ) );
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 );
|
||||
|
||||
Reference in New Issue
Block a user