The Great Renamening of 2020

This commit is contained in:
Sebastian Hartte
2020-06-22 12:14:54 +02:00
parent abe3334488
commit b4471b1abb
441 changed files with 3395 additions and 3468 deletions
@@ -44,35 +44,35 @@ import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.OptionalSlotRestrictedInput;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.misc.TileCellWorkbench;
import appeng.container.slot.OptionalRestrictedInputSlot;
import appeng.container.slot.FakeTypeOnlySlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.misc.CellWorkbenchTileEntity;
import appeng.util.EnumCycler;
import appeng.util.Platform;
import appeng.util.helpers.ItemHandlerUtil;
import appeng.util.inv.WrapperSupplierItemHandler;
import appeng.util.iterators.NullIterator;
public class ContainerCellWorkbench extends ContainerUpgradeable {
public class CellWorkbenchContainer extends UpgradeableContainer {
public static ContainerType<ContainerCellWorkbench> TYPE;
public static ContainerType<CellWorkbenchContainer> TYPE;
private static final ContainerHelper<ContainerCellWorkbench, TileCellWorkbench> helper = new ContainerHelper<>(
ContainerCellWorkbench::new, TileCellWorkbench.class);
private static final ContainerHelper<CellWorkbenchContainer, CellWorkbenchTileEntity> helper = new ContainerHelper<>(
CellWorkbenchContainer::new, CellWorkbenchTileEntity.class);
private final TileCellWorkbench workBench;
private final CellWorkbenchTileEntity workBench;
@GuiSync(2)
public CopyMode copyMode = CopyMode.CLEAR_ON_REMOVE;
private ItemStack prevStack = ItemStack.EMPTY;
private int lastUpgrades = 0;
public ContainerCellWorkbench(int id, final PlayerInventory ip, final TileCellWorkbench te) {
public CellWorkbenchContainer(int id, final PlayerInventory ip, final CellWorkbenchTileEntity te) {
super(TYPE, id, ip, te);
this.workBench = te;
}
public static ContainerCellWorkbench fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CellWorkbenchContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -103,7 +103,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable {
@Override
protected void setupConfig() {
final IItemHandler cell = this.getUpgradeable().getInventoryByName("cell");
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8,
this.getPlayerInv()));
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
@@ -116,7 +116,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable {
final int x = 8;
for (int w = 0; w < 7; w++) {
for (int z = 0; z < 9; z++) {
this.addSlot(new SlotFakeTypeOnly(inv, offset, x + z * 18, y + w * 18));
this.addSlot(new FakeTypeOnlySlot(inv, offset, x + z * 18, y + w * 18));
offset++;
}
}
@@ -124,7 +124,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable {
for (int zz = 0; zz < 3; zz++) {
for (int z = 0; z < 8; z++) {
final int iSLot = zz * 8 + z;
this.addSlot(new OptionalSlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES,
this.addSlot(new OptionalRestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES,
upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.getPlayerInventory()));
}
}
@@ -157,8 +157,8 @@ public class ContainerCellWorkbench extends ContainerUpgradeable {
if (this.prevStack != is) {
// if the bars changed an item was probably made, so just send shit!
for (final Slot s : this.inventorySlots) {
if (s instanceof OptionalSlotRestrictedInput) {
final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
if (s instanceof OptionalRestrictedInputSlot) {
final OptionalRestrictedInputSlot sri = (OptionalRestrictedInputSlot) s;
listener.sendSlotContents(this, sri.slotNumber, sri.getStack());
}
}
@@ -26,26 +26,26 @@ import net.minecraft.network.PacketBuffer;
import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.storage.TileChest;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.storage.ChestTileEntity;
public class ContainerChest extends AEBaseContainer {
public class ChestContainer extends AEBaseContainer {
public static ContainerType<ContainerChest> TYPE;
public static ContainerType<ChestContainer> TYPE;
private static final ContainerHelper<ContainerChest, TileChest> helper = new ContainerHelper<>(ContainerChest::new,
TileChest.class, SecurityPermissions.BUILD);
private static final ContainerHelper<ChestContainer, ChestTileEntity> helper = new ContainerHelper<>(ChestContainer::new,
ChestTileEntity.class, SecurityPermissions.BUILD);
public ContainerChest(int id, final PlayerInventory ip, final TileChest chest) {
public ChestContainer(int id, final PlayerInventory ip, final ChestTileEntity chest) {
super(TYPE, id, ip, chest, null);
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.STORAGE_CELLS,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.STORAGE_CELLS,
chest.getInternalInventory(), 1, 80, 37, this.getPlayerInventory()));
this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */82);
}
public static ContainerChest fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static ChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -30,19 +30,19 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.misc.TileCondenser;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.misc.CondenserTileEntity;
import appeng.util.Platform;
public class ContainerCondenser extends AEBaseContainer implements IProgressProvider {
public class CondenserContainer extends AEBaseContainer implements IProgressProvider {
public static ContainerType<ContainerCondenser> TYPE;
public static ContainerType<CondenserContainer> TYPE;
private static final ContainerHelper<ContainerCondenser, TileCondenser> helper = new ContainerHelper<>(
ContainerCondenser::new, TileCondenser.class);
private static final ContainerHelper<CondenserContainer, CondenserTileEntity> helper = new ContainerHelper<>(
CondenserContainer::new, CondenserTileEntity.class);
private final TileCondenser condenser;
private final CondenserTileEntity condenser;
@GuiSync(0)
public long requiredEnergy = 0;
@GuiSync(1)
@@ -50,22 +50,22 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
@GuiSync(2)
public CondenserOutput output = CondenserOutput.TRASH;
public ContainerCondenser(int id, final PlayerInventory ip, final TileCondenser condenser) {
public CondenserContainer(int id, final PlayerInventory ip, final CondenserTileEntity condenser) {
super(TYPE, id, ip, condenser, null);
this.condenser = condenser;
IItemHandler inv = condenser.getInternalInventory();
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.TRASH, inv, 0, 51, 52, ip));
this.addSlot(new SlotOutput(inv, 1, 105, 52, -1));
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.TRASH, inv, 0, 51, 52, ip));
this.addSlot(new OutputSlot(inv, 1, 105, 52, -1));
this.addSlot(
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, inv, 2, 101, 26, ip))
(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.STORAGE_COMPONENT, inv, 2, 101, 26, ip))
.setStackLimit(1));
this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */82);
}
public static ContainerCondenser fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CondenserContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -35,28 +35,28 @@ import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotInaccessible;
import appeng.container.slot.InaccessibleSlot;
import appeng.me.helpers.PlayerSource;
import appeng.tile.inventory.AppEngInternalInventory;
public class ContainerCraftAmount extends AEBaseContainer {
public class CraftAmountContainer extends AEBaseContainer {
public static ContainerType<ContainerCraftAmount> TYPE;
public static ContainerType<CraftAmountContainer> TYPE;
private static final ContainerHelper<ContainerCraftAmount, ITerminalHost> helper = new ContainerHelper<>(
ContainerCraftAmount::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<CraftAmountContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftAmountContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private final Slot craftingItem;
private IAEItemStack itemToCreate;
public ContainerCraftAmount(int id, PlayerInventory ip, final ITerminalHost te) {
public CraftAmountContainer(int id, PlayerInventory ip, final ITerminalHost te) {
super(TYPE, id, ip, te);
this.craftingItem = new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, 34, 53);
this.craftingItem = new InaccessibleSlot(new AppEngInternalInventory(null, 1), 0, 34, 53);
this.addSlot(this.getCraftingItem());
}
public static ContainerCraftAmount fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftAmountContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -59,22 +59,22 @@ import appeng.container.ContainerOpener;
import appeng.container.guisync.GuiSync;
import appeng.core.AELog;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.core.sync.packets.MEInventoryUpdatePacket;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.me.helpers.PlayerSource;
import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.parts.reporting.PartTerminal;
import appeng.parts.reporting.CraftingTerminalPart;
import appeng.parts.reporting.PatternTerminalPart;
import appeng.parts.reporting.TerminalPart;
import appeng.util.Platform;
public class ContainerCraftConfirm extends AEBaseContainer {
public class CraftConfirmContainer extends AEBaseContainer {
public static ContainerType<ContainerCraftConfirm> TYPE;
public static ContainerType<CraftConfirmContainer> TYPE;
private static final ContainerHelper<ContainerCraftConfirm, ITerminalHost> helper = new ContainerHelper<>(
ContainerCraftConfirm::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<CraftConfirmContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftConfirmContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static ContainerCraftConfirm fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftConfirmContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -102,7 +102,7 @@ public class ContainerCraftConfirm extends AEBaseContainer {
@GuiSync(7)
public ITextComponent myName;
public ContainerCraftConfirm(int id, PlayerInventory ip, ITerminalHost te) {
public CraftConfirmContainer(int id, PlayerInventory ip, ITerminalHost te) {
super(TYPE, id, ip, te);
}
@@ -192,9 +192,9 @@ public class ContainerCraftConfirm extends AEBaseContainer {
}
try {
final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate((byte) 0);
final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate((byte) 1);
final PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate((byte) 2)
final MEInventoryUpdatePacket a = new MEInventoryUpdatePacket((byte) 0);
final MEInventoryUpdatePacket b = new MEInventoryUpdatePacket((byte) 1);
final MEInventoryUpdatePacket c = this.result.isSimulation() ? new MEInventoryUpdatePacket((byte) 2)
: null;
final IItemList<IAEItemStack> plan = AEApi.instance().storage()
@@ -297,19 +297,19 @@ public class ContainerCraftConfirm extends AEBaseContainer {
final IActionHost ah = this.getActionHost();
if (ah instanceof WirelessTerminalGuiObject) {
originalGui = ContainerWirelessTerm.TYPE;
originalGui = WirelessTermContainer.TYPE;
}
if (ah instanceof PartTerminal) {
originalGui = ContainerMEMonitorable.TYPE;
if (ah instanceof TerminalPart) {
originalGui = MEMonitorableContainer.TYPE;
}
if (ah instanceof PartCraftingTerminal) {
originalGui = ContainerCraftingTerm.TYPE;
if (ah instanceof CraftingTerminalPart) {
originalGui = CraftingTermContainer.TYPE;
}
if (ah instanceof PartPatternTerminal) {
originalGui = ContainerPatternTerm.TYPE;
if (ah instanceof PatternTerminalPart) {
originalGui = PatternTermContainer.TYPE;
}
if (this.result != null && !this.isSimulation()) {
@@ -44,21 +44,21 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.core.sync.packets.MEInventoryUpdatePacket;
import appeng.core.sync.packets.ConfigValuePacket;
import appeng.helpers.ICustomNameObject;
import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.CraftingCPUCluster;
import appeng.tile.crafting.TileCraftingTile;
import appeng.tile.crafting.CraftingTileEntity;
import appeng.util.Platform;
public class ContainerCraftingCPU extends AEBaseContainer
public class CraftingCPUContainer extends AEBaseContainer
implements IMEMonitorHandlerReceiver<IAEItemStack>, ICustomNameObject {
public static ContainerType<ContainerCraftingCPU> TYPE;
public static ContainerType<CraftingCPUContainer> TYPE;
private static final ContainerHelper<ContainerCraftingCPU, TileCraftingTile> helper = new ContainerHelper<>(
ContainerCraftingCPU::new, TileCraftingTile.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<CraftingCPUContainer, CraftingTileEntity> helper = new ContainerHelper<>(
CraftingCPUContainer::new, CraftingTileEntity.class, SecurityPermissions.CRAFT);
private final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)
.createList();
@@ -69,11 +69,11 @@ public class ContainerCraftingCPU extends AEBaseContainer
@GuiSync(0)
public long eta = -1;
private ContainerCraftingCPU(int id, final PlayerInventory ip, final TileCraftingTile te) {
private CraftingCPUContainer(int id, final PlayerInventory ip, final CraftingTileEntity te) {
this(TYPE, id, ip, te);
}
public ContainerCraftingCPU(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object te) {
public CraftingCPUContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object te) {
super(containerType, id, ip, te);
final IActionHost host = (IActionHost) (te instanceof IActionHost ? te : null);
@@ -81,7 +81,7 @@ public class ContainerCraftingCPU extends AEBaseContainer
this.setNetwork(host.getActionableNode().getGrid());
}
if (te instanceof TileCraftingTile) {
if (te instanceof CraftingTileEntity) {
this.setCPU((ICraftingCPU) ((IAEMultiBlock) te).getCluster());
}
@@ -90,7 +90,7 @@ public class ContainerCraftingCPU extends AEBaseContainer
}
}
public static ContainerCraftingCPU fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingCPUContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -109,7 +109,7 @@ public class ContainerCraftingCPU extends AEBaseContainer
for (final Object g : this.listeners) {
if (g instanceof PlayerEntity) {
NetworkHandler.instance().sendTo(new PacketValueConfig("CraftingStatus", "Clear"),
NetworkHandler.instance().sendTo(new ConfigValuePacket("CraftingStatus", "Clear"),
(ServerPlayerEntity) g);
}
}
@@ -165,9 +165,9 @@ public class ContainerCraftingCPU extends AEBaseContainer
this.setEstimatedTime(eta);
}
final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate((byte) 0);
final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate((byte) 1);
final PacketMEInventoryUpdate c = new PacketMEInventoryUpdate((byte) 2);
final MEInventoryUpdatePacket a = new MEInventoryUpdatePacket((byte) 0);
final MEInventoryUpdatePacket b = new MEInventoryUpdatePacket((byte) 1);
final MEInventoryUpdatePacket c = new MEInventoryUpdatePacket((byte) 2);
for (final IAEItemStack out : this.list) {
a.appendItem(this.getMonitor().getItemStack(out, CraftingItemList.STORAGE));
@@ -38,14 +38,14 @@ import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.util.Platform;
public class ContainerCraftingStatus extends ContainerCraftingCPU {
public class CraftingStatusContainer extends CraftingCPUContainer {
public static ContainerType<ContainerCraftingStatus> TYPE;
public static ContainerType<CraftingStatusContainer> TYPE;
private static final ContainerHelper<ContainerCraftingStatus, ITerminalHost> helper = new ContainerHelper<>(
ContainerCraftingStatus::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<CraftingStatusContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftingStatusContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static ContainerCraftingStatus fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -61,7 +61,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU {
@GuiSync(7)
public ITextComponent myName;
public ContainerCraftingStatus(int id, final PlayerInventory ip, final ITerminalHost te) {
public CraftingStatusContainer(int id, final PlayerInventory ip, final ITerminalHost te) {
super(TYPE, id, ip, te);
}
@@ -35,24 +35,24 @@ import appeng.api.config.SecurityPermissions;
import appeng.api.storage.ITerminalHost;
import appeng.container.ContainerLocator;
import appeng.container.ContainerNull;
import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotCraftingTerm;
import appeng.container.slot.CraftingMatrixSlot;
import appeng.container.slot.CraftingTermSlot;
import appeng.helpers.IContainerCraftingPacket;
import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.CraftingTerminalPart;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
import appeng.util.inv.WrapperInvItemHandler;
public class ContainerCraftingTerm extends ContainerMEMonitorable
public class CraftingTermContainer extends MEMonitorableContainer
implements IAEAppEngInventory, IContainerCraftingPacket {
public static ContainerType<ContainerCraftingTerm> TYPE;
public static ContainerType<CraftingTermContainer> TYPE;
private static final ContainerHelper<ContainerCraftingTerm, ITerminalHost> helper = new ContainerHelper<>(
ContainerCraftingTerm::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<CraftingTermContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftingTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static ContainerCraftingTerm fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -60,26 +60,26 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable
return helper.open(player, locator);
}
private final PartCraftingTerminal ct;
private final CraftingTerminalPart ct;
private final AppEngInternalInventory output = new AppEngInternalInventory(this, 1);
private final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
private final SlotCraftingTerm outputSlot;
private final CraftingMatrixSlot[] craftingSlots = new CraftingMatrixSlot[9];
private final CraftingTermSlot outputSlot;
private IRecipe<CraftingInventory> currentRecipe;
public ContainerCraftingTerm(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
public CraftingTermContainer(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
super(TYPE, id, ip, monitorable, false);
this.ct = (PartCraftingTerminal) monitorable;
this.ct = (CraftingTerminalPart) monitorable;
final IItemHandler crafting = this.ct.getInventoryByName("crafting");
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
this.addSlot(this.craftingSlots[x + y * 3] = new SlotCraftingMatrix(this, crafting, x + y * 3,
this.addSlot(this.craftingSlots[x + y * 3] = new CraftingMatrixSlot(this, crafting, x + y * 3,
37 + x * 18, -72 + y * 18));
}
}
this.addSlot(this.outputSlot = new SlotCraftingTerm(this.getPlayerInv().player, this.getActionSource(),
this.addSlot(this.outputSlot = new CraftingTermSlot(this.getPlayerInv().player, this.getActionSource(),
this.getPowerSource(), monitorable, crafting, crafting, this.output, 131, -72 + 18, this));
this.bindPlayerInventory(ip, 0, 0);
@@ -25,17 +25,17 @@ import net.minecraft.network.PacketBuffer;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.storage.TileDrive;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.storage.DriveTileEntity;
public class ContainerDrive extends AEBaseContainer {
public class DriveContainer extends AEBaseContainer {
public static ContainerType<ContainerDrive> TYPE;
public static ContainerType<DriveContainer> TYPE;
private static final ContainerHelper<ContainerDrive, TileDrive> helper = new ContainerHelper<>(ContainerDrive::new,
TileDrive.class);
private static final ContainerHelper<DriveContainer, DriveTileEntity> helper = new ContainerHelper<>(DriveContainer::new,
DriveTileEntity.class);
public static ContainerDrive fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static DriveContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -43,12 +43,12 @@ public class ContainerDrive extends AEBaseContainer {
return helper.open(player, locator);
}
public ContainerDrive(int id, final PlayerInventory ip, final TileDrive drive) {
public DriveContainer(int id, final PlayerInventory ip, final DriveTileEntity drive) {
super(TYPE, id, ip, drive, null);
for (int y = 0; y < 5; y++) {
for (int x = 0; x < 2; x++) {
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.STORAGE_CELLS,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.STORAGE_CELLS,
drive.getInternalInventory(), x + y * 2, 71 + x * 18, 14 + y * 18, this.getPlayerInventory()));
}
}
@@ -31,20 +31,20 @@ import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.OptionalSlotFakeTypeOnly;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.parts.automation.PartFormationPlane;
import appeng.container.slot.OptionalTypeOnlyFakeSlot;
import appeng.container.slot.FakeTypeOnlySlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.parts.automation.FormationPlanePart;
import appeng.util.Platform;
public class ContainerFormationPlane extends ContainerUpgradeable {
public class FormationPlaneContainer extends UpgradeableContainer {
public static ContainerType<ContainerFormationPlane> TYPE;
public static ContainerType<FormationPlaneContainer> TYPE;
private static final ContainerHelper<ContainerFormationPlane, PartFormationPlane> helper = new ContainerHelper<>(
ContainerFormationPlane::new, PartFormationPlane.class, SecurityPermissions.BUILD);
private static final ContainerHelper<FormationPlaneContainer, FormationPlanePart> helper = new ContainerHelper<>(
FormationPlaneContainer::new, FormationPlanePart.class, SecurityPermissions.BUILD);
public static ContainerFormationPlane fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static FormationPlaneContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -55,7 +55,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable {
@GuiSync(6)
public YesNo placeMode;
public ContainerFormationPlane(int id, final PlayerInventory ip, final PartFormationPlane te) {
public FormationPlaneContainer(int id, final PlayerInventory ip, final FormationPlanePart te) {
super(TYPE, id, ip, te);
}
@@ -73,23 +73,23 @@ public class ContainerFormationPlane extends ContainerUpgradeable {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 9; x++) {
if (y < 2) {
this.addSlot(new SlotFakeTypeOnly(config, y * 9 + x, xo + x * 18, yo + y * 18));
this.addSlot(new FakeTypeOnlySlot(config, y * 9 + x, xo + x * 18, yo + y * 18));
} else {
this.addSlot(new OptionalSlotFakeTypeOnly(config, this, y * 9 + x, xo, yo, x, y, y - 2));
this.addSlot(new OptionalTypeOnlyFakeSlot(config, this, y * 9 + x, xo, yo, x, y, y - 2));
}
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 3, 187,
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 4, 187,
8 + 18 * 4, this.getPlayerInventory())).setNotDraggable());
}
@@ -26,19 +26,19 @@ import net.minecraftforge.items.IItemHandler;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotInaccessible;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.grindstone.TileGrinder;
import appeng.container.slot.InaccessibleSlot;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.grindstone.GrinderTileEntity;
public class ContainerGrinder extends AEBaseContainer {
public class GrinderContainer extends AEBaseContainer {
public static ContainerType<ContainerGrinder> TYPE;
public static ContainerType<GrinderContainer> TYPE;
private static final ContainerHelper<ContainerGrinder, TileGrinder> helper = new ContainerHelper<>(
ContainerGrinder::new, TileGrinder.class);
private static final ContainerHelper<GrinderContainer, GrinderTileEntity> helper = new ContainerHelper<>(
GrinderContainer::new, GrinderTileEntity.class);
public static ContainerGrinder fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static GrinderContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -46,23 +46,23 @@ public class ContainerGrinder extends AEBaseContainer {
return helper.open(player, locator);
}
public ContainerGrinder(int id, final PlayerInventory ip, final TileGrinder grinder) {
public GrinderContainer(int id, final PlayerInventory ip, final GrinderTileEntity grinder) {
super(TYPE, id, ip, grinder, null);
IItemHandler inv = grinder.getInternalInventory();
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ORE, inv, 0, 12, 17,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ORE, inv, 0, 12, 17,
this.getPlayerInventory()));
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ORE, inv, 1, 12 + 18, 17,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ORE, inv, 1, 12 + 18, 17,
this.getPlayerInventory()));
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ORE, inv, 2, 12 + 36, 17,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ORE, inv, 2, 12 + 36, 17,
this.getPlayerInventory()));
this.addSlot(new SlotInaccessible(inv, 6, 80, 40));
this.addSlot(new InaccessibleSlot(inv, 6, 80, 40));
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.addSlot(new OutputSlot(inv, 3, 112, 63, 2 * 16 + 15));
this.addSlot(new OutputSlot(inv, 4, 112 + 18, 63, 2 * 16 + 15));
this.addSlot(new OutputSlot(inv, 5, 112 + 36, 63, 2 * 16 + 15));
this.bindPlayerInventory(ip, 0, 176 - /* height of player inventory */82);
}
@@ -31,19 +31,19 @@ import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.storage.TileIOPort;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.storage.IOPortTileEntity;
import appeng.util.Platform;
public class ContainerIOPort extends ContainerUpgradeable {
public class IOPortContainer extends UpgradeableContainer {
public static ContainerType<ContainerIOPort> TYPE;
public static ContainerType<IOPortContainer> TYPE;
private static final ContainerHelper<ContainerIOPort, TileIOPort> helper = new ContainerHelper<>(
ContainerIOPort::new, TileIOPort.class, SecurityPermissions.BUILD);
private static final ContainerHelper<IOPortContainer, IOPortTileEntity> helper = new ContainerHelper<>(
IOPortContainer::new, IOPortTileEntity.class, SecurityPermissions.BUILD);
public static ContainerIOPort fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static IOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -56,7 +56,7 @@ public class ContainerIOPort extends ContainerUpgradeable {
@GuiSync(3)
public OperationMode opMode = OperationMode.EMPTY;
public ContainerIOPort(int id, final PlayerInventory ip, final TileIOPort te) {
public IOPortContainer(int id, final PlayerInventory ip, final IOPortTileEntity te) {
super(TYPE, id, ip, te);
}
@@ -74,7 +74,7 @@ public class ContainerIOPort extends ContainerUpgradeable {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 2; x++) {
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.STORAGE_CELLS, cells,
x + y * 2, offX + x * 18, offY + y * 18, this.getPlayerInventory()));
}
}
@@ -83,17 +83,17 @@ public class ContainerIOPort extends ContainerUpgradeable {
offY = 17;
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 2; x++) {
this.addSlot(new SlotOutput(cells, 6 + x + y * 2, offX + x * 18, offY + y * 18,
SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon));
this.addSlot(new OutputSlot(cells, 6 + x + y * 2, offX + x * 18, offY + y * 18,
RestrictedInputSlot.PlacableItemType.STORAGE_CELLS.IIcon));
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
}
@@ -31,10 +31,10 @@ import appeng.api.definitions.IItemDefinition;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.misc.InscriberRecipes;
import appeng.tile.misc.TileInscriber;
import appeng.tile.misc.InscriberTileEntity;
import appeng.util.Platform;
/**
@@ -43,14 +43,14 @@ import appeng.util.Platform;
* @version rv2
* @since rv0
*/
public class ContainerInscriber extends ContainerUpgradeable implements IProgressProvider {
public class InscriberContainer extends UpgradeableContainer implements IProgressProvider {
public static ContainerType<ContainerInscriber> TYPE;
public static ContainerType<InscriberContainer> TYPE;
private static final ContainerHelper<ContainerInscriber, TileInscriber> helper = new ContainerHelper<>(
ContainerInscriber::new, TileInscriber.class);
private static final ContainerHelper<InscriberContainer, InscriberTileEntity> helper = new ContainerHelper<>(
InscriberContainer::new, InscriberTileEntity.class);
public static ContainerInscriber fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InscriberContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -58,7 +58,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
return helper.open(player, locator);
}
private final TileInscriber ti;
private final InscriberTileEntity ti;
private final Slot top;
private final Slot middle;
@@ -70,26 +70,26 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@GuiSync(3)
public int processingTime = -1;
public ContainerInscriber(int id, final PlayerInventory ip, final TileInscriber te) {
public InscriberContainer(int id, final PlayerInventory ip, final InscriberTileEntity te) {
super(TYPE, id, ip, te);
this.ti = te;
IItemHandler inv = te.getInternalInventory();
SlotRestrictedInput top = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv, 0,
RestrictedInputSlot top = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.INSCRIBER_PLATE, inv, 0,
45, 16, this.getPlayerInventory());
top.setStackLimit(1);
this.top = this.addSlot(top);
SlotRestrictedInput bottom = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv,
RestrictedInputSlot bottom = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.INSCRIBER_PLATE, inv,
1, 45, 62, this.getPlayerInventory());
bottom.setStackLimit(1);
this.bottom = this.addSlot(bottom);
SlotRestrictedInput middle = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, inv,
RestrictedInputSlot middle = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.INSCRIBER_INPUT, inv,
2, 63, 39, this.getPlayerInventory());
middle.setStackLimit(1);
this.middle = this.addSlot(middle);
this.addSlot(new SlotOutput(inv, 3, 113, 40, -1));
this.addSlot(new OutputSlot(inv, 3, 113, 40, -1));
}
@Override
@@ -29,20 +29,20 @@ import appeng.api.config.YesNo;
import appeng.api.util.IConfigManager;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotFake;
import appeng.container.slot.SlotNormal;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.FakeSlot;
import appeng.container.slot.NormalSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
public class ContainerInterface extends ContainerUpgradeable {
public class InterfaceContainer extends UpgradeableContainer {
public static ContainerType<ContainerInterface> TYPE;
public static ContainerType<InterfaceContainer> TYPE;
private static final ContainerHelper<ContainerInterface, IInterfaceHost> helper = new ContainerHelper<>(
ContainerInterface::new, IInterfaceHost.class, SecurityPermissions.BUILD);
private static final ContainerHelper<InterfaceContainer, IInterfaceHost> helper = new ContainerHelper<>(
InterfaceContainer::new, IInterfaceHost.class, SecurityPermissions.BUILD);
public static ContainerInterface fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InterfaceContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -58,22 +58,22 @@ public class ContainerInterface extends ContainerUpgradeable {
@GuiSync(4)
public YesNo iTermMode = YesNo.YES;
public ContainerInterface(int id, final PlayerInventory ip, final IInterfaceHost te) {
public InterfaceContainer(int id, final PlayerInventory ip, final IInterfaceHost te) {
super(TYPE, id, ip, te.getInterfaceDuality().getHost());
this.myDuality = te.getInterfaceDuality();
for (int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++) {
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.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.addSlot(new SlotFake(this.myDuality.getConfig(), x, 8 + 18 * x, 35));
this.addSlot(new FakeSlot(this.myDuality.getConfig(), x, 8 + 18 * x, 35));
}
for (int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++) {
this.addSlot(new SlotNormal(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
this.addSlot(new NormalSlot(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
}
}
@@ -42,15 +42,15 @@ import appeng.api.networking.security.IActionHost;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketCompressedNBT;
import appeng.core.sync.packets.CompressedNBTPacket;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import appeng.helpers.InventoryAction;
import appeng.items.misc.ItemEncodedPattern;
import appeng.parts.misc.PartInterface;
import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.items.misc.EncodedPatternItem;
import appeng.parts.misc.InterfacePart;
import appeng.parts.reporting.InterfaceTerminalPart;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.misc.TileInterface;
import appeng.tile.misc.InterfaceTileEntity;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.helpers.ItemHandlerUtil;
@@ -60,14 +60,14 @@ import appeng.util.inv.WrapperFilteredItemHandler;
import appeng.util.inv.WrapperRangeItemHandler;
import appeng.util.inv.filter.IAEItemFilter;
public final class ContainerInterfaceTerminal extends AEBaseContainer {
public final class InterfaceTerminalContainer extends AEBaseContainer {
public static ContainerType<ContainerInterfaceTerminal> TYPE;
public static ContainerType<InterfaceTerminalContainer> TYPE;
private static final ContainerHelper<ContainerInterfaceTerminal, PartInterfaceTerminal> helper = new ContainerHelper<>(
ContainerInterfaceTerminal::new, PartInterfaceTerminal.class, SecurityPermissions.BUILD);
private static final ContainerHelper<InterfaceTerminalContainer, InterfaceTerminalPart> helper = new ContainerHelper<>(
InterfaceTerminalContainer::new, InterfaceTerminalPart.class, SecurityPermissions.BUILD);
public static ContainerInterfaceTerminal fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InterfaceTerminalContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -85,7 +85,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
private IGrid grid;
private CompoundNBT data = new CompoundNBT();
public ContainerInterfaceTerminal(int id, final PlayerInventory ip, final PartInterfaceTerminal anchor) {
public InterfaceTerminalContainer(int id, final PlayerInventory ip, final InterfaceTerminalPart anchor) {
super(TYPE, id, ip, anchor);
if (Platform.isServer()) {
@@ -114,7 +114,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
if (host != null) {
final IGridNode agn = host.getActionableNode();
if (agn != null && agn.isActive()) {
for (final IGridNode gn : this.grid.getMachines(TileInterface.class)) {
for (final IGridNode gn : this.grid.getMachines(InterfaceTileEntity.class)) {
if (gn.isActive()) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
if (ih.getInterfaceDuality().getConfigManager()
@@ -137,7 +137,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
}
}
for (final IGridNode gn : this.grid.getMachines(PartInterface.class)) {
for (final IGridNode gn : this.grid.getMachines(InterfacePart.class)) {
if (gn.isActive()) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
if (ih.getInterfaceDuality().getConfigManager()
@@ -177,7 +177,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
if (!this.data.isEmpty()) {
try {
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data),
NetworkHandler.instance().sendTo(new CompressedNBTPacket(this.data),
(ServerPlayerEntity) this.getPlayerInv().player);
} catch (final IOException e) {
// :P
@@ -288,7 +288,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
if (host != null) {
final IGridNode agn = host.getActionableNode();
if (agn != null && agn.isActive()) {
for (final IGridNode gn : this.grid.getMachines(TileInterface.class)) {
for (final IGridNode gn : this.grid.getMachines(InterfaceTileEntity.class)) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
final DualityInterface dual = ih.getInterfaceDuality();
if (gn.isActive() && dual.getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.YES) {
@@ -296,7 +296,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
}
}
for (final IGridNode gn : this.grid.getMachines(PartInterface.class)) {
for (final IGridNode gn : this.grid.getMachines(InterfacePart.class)) {
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
final DualityInterface dual = ih.getInterfaceDuality();
if (gn.isActive() && dual.getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.YES) {
@@ -378,7 +378,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
@Override
public boolean allowInsert(IItemHandler inv, int slot, ItemStack stack) {
return !stack.isEmpty() && stack.getItem() instanceof ItemEncodedPattern;
return !stack.isEmpty() && stack.getItem() instanceof EncodedPatternItem;
}
}
}
@@ -35,19 +35,19 @@ import appeng.api.config.Settings;
import appeng.api.config.YesNo;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.parts.automation.PartLevelEmitter;
import appeng.container.slot.FakeTypeOnlySlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.parts.automation.LevelEmitterPart;
import appeng.util.Platform;
public class ContainerLevelEmitter extends ContainerUpgradeable {
public class LevelEmitterContainer extends UpgradeableContainer {
public static ContainerType<ContainerLevelEmitter> TYPE;
public static ContainerType<LevelEmitterContainer> TYPE;
private static final ContainerHelper<ContainerLevelEmitter, PartLevelEmitter> helper = new ContainerHelper<>(
ContainerLevelEmitter::new, PartLevelEmitter.class, SecurityPermissions.BUILD);
private static final ContainerHelper<LevelEmitterContainer, LevelEmitterPart> helper = new ContainerHelper<>(
LevelEmitterContainer::new, LevelEmitterPart.class, SecurityPermissions.BUILD);
public static ContainerLevelEmitter fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static LevelEmitterContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -55,7 +55,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable {
return helper.open(player, locator);
}
private final PartLevelEmitter lvlEmitter;
private final LevelEmitterPart lvlEmitter;
@OnlyIn(Dist.CLIENT)
private TextFieldWidget textField;
@@ -66,7 +66,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable {
@GuiSync(4)
public YesNo cmType;
public ContainerLevelEmitter(int id, final PlayerInventory ip, final PartLevelEmitter te) {
public LevelEmitterContainer(int id, final PlayerInventory ip, final LevelEmitterPart te) {
super(TYPE, id, ip, te);
this.lvlEmitter = te;
}
@@ -86,26 +86,26 @@ public class ContainerLevelEmitter extends ContainerUpgradeable {
protected void setupConfig() {
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
if (this.availableUpgrades() > 0) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 1) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187,
8 + 18, this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 2) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 3) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 3, 187,
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
}
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final int y = 40;
final int x = 80 + 44;
this.addSlot(new SlotFakeTypeOnly(inv, 0, x, y));
this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y));
}
@Override
@@ -65,25 +65,25 @@ import appeng.api.util.IConfigurableObject;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.RestrictedInputSlot;
import appeng.core.AELog;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.core.sync.packets.MEInventoryUpdatePacket;
import appeng.core.sync.packets.ConfigValuePacket;
import appeng.me.helpers.ChannelPowerSrc;
import appeng.util.ConfigManager;
import appeng.util.IConfigManagerHost;
import appeng.util.Platform;
public class ContainerMEMonitorable extends AEBaseContainer
public class MEMonitorableContainer extends AEBaseContainer
implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<IAEItemStack> {
public static ContainerType<ContainerMEMonitorable> TYPE;
public static ContainerType<MEMonitorableContainer> TYPE;
private static final ContainerHelper<ContainerMEMonitorable, ITerminalHost> helper = new ContainerHelper<>(
ContainerMEMonitorable::new, ITerminalHost.class);
private static final ContainerHelper<MEMonitorableContainer, ITerminalHost> helper = new ContainerHelper<>(
MEMonitorableContainer::new, ITerminalHost.class);
public static ContainerMEMonitorable fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MEMonitorableContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -91,7 +91,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
return helper.open(player, locator);
}
private final SlotRestrictedInput[] cellView = new SlotRestrictedInput[5];
private final RestrictedInputSlot[] cellView = new RestrictedInputSlot[5];
private final IMEMonitor<IAEItemStack> monitor;
private final IItemList<IAEItemStack> items = AEApi.instance().storage()
.getStorageChannel(IItemStorageChannel.class).createList();
@@ -105,12 +105,12 @@ public class ContainerMEMonitorable extends AEBaseContainer
private IConfigManager serverCM;
private IGridNode networkNode;
public ContainerMEMonitorable(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
public MEMonitorableContainer(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
this(TYPE, id, ip, monitorable, true);
}
public ContainerMEMonitorable(ContainerType<?> containerType, int id, PlayerInventory ip,
final ITerminalHost monitorable, final boolean bindInventory) {
public MEMonitorableContainer(ContainerType<?> containerType, int id, PlayerInventory ip,
final ITerminalHost monitorable, final boolean bindInventory) {
super(containerType, id, ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null,
monitorable instanceof IPart ? (IPart) monitorable : null,
monitorable instanceof IGuiItemObject ? (IGuiItemObject) monitorable : null);
@@ -164,7 +164,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
this.canAccessViewCells = false;
if (monitorable instanceof IViewCellStorage) {
for (int y = 0; y < 5; y++) {
this.cellView[y] = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.VIEW_CELL,
this.cellView[y] = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.VIEW_CELL,
((IViewCellStorage) monitorable).getViewCellStorage(), y, 206, y * 18 + 8,
this.getPlayerInventory());
this.cellView[y].setAllowEdit(this.canAccessViewCells);
@@ -197,7 +197,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
this.clientCM.putSetting(set, sideLocal);
for (final IContainerListener crafter : this.listeners) {
if (crafter instanceof ServerPlayerEntity) {
NetworkHandler.instance().sendTo(new PacketValueConfig(set.name(), sideLocal.name()),
NetworkHandler.instance().sendTo(new ConfigValuePacket(set.name(), sideLocal.name()),
(ServerPlayerEntity) crafter);
}
}
@@ -208,7 +208,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
try {
final IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
final MEInventoryUpdatePacket piu = new MEInventoryUpdatePacket();
for (final IAEItemStack is : this.items) {
final IAEItemStack send = monitorCache.findPrecise(is);
@@ -289,7 +289,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
private void queueInventory(final IContainerListener c) {
if (Platform.isServer() && c instanceof PlayerEntity && this.monitor != null) {
try {
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
MEInventoryUpdatePacket piu = new MEInventoryUpdatePacket();
final IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
for (final IAEItemStack send : monitorCache) {
@@ -298,7 +298,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
} catch (final BufferOverflowException boe) {
NetworkHandler.instance().sendTo(piu, (ServerPlayerEntity) c);
piu = new PacketMEInventoryUpdate();
piu = new MEInventoryUpdatePacket();
piu.appendItem(send);
}
}
@@ -372,7 +372,7 @@ public class ContainerMEMonitorable extends AEBaseContainer
return list;
}
public SlotRestrictedInput getCellViewSlot(final int index) {
public RestrictedInputSlot getCellViewSlot(final int index) {
return this.cellView[index];
}
@@ -30,14 +30,14 @@ import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.container.ContainerLocator;
import appeng.container.interfaces.IInventorySlotAware;
public class ContainerMEPortableCell extends ContainerMEMonitorable {
public class MEPortableCellContainer extends MEMonitorableContainer {
public static ContainerType<ContainerMEPortableCell> TYPE;
public static ContainerType<MEPortableCellContainer> TYPE;
private static final ContainerHelper<ContainerMEPortableCell, IPortableCell> helper = new ContainerHelper<>(
ContainerMEPortableCell::new, IPortableCell.class);
private static final ContainerHelper<MEPortableCellContainer, IPortableCell> helper = new ContainerHelper<>(
MEPortableCellContainer::new, IPortableCell.class);
public static ContainerMEPortableCell fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MEPortableCellContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -51,12 +51,12 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable {
private int ticks = 0;
private final int slot;
public ContainerMEPortableCell(int id, final PlayerInventory ip, final IPortableCell monitorable) {
public MEPortableCellContainer(int id, final PlayerInventory ip, final IPortableCell monitorable) {
this(TYPE, id, ip, monitorable);
}
protected ContainerMEPortableCell(ContainerType<? extends ContainerMEPortableCell> type, int id,
final PlayerInventory ip, final IPortableCell monitorable) {
protected MEPortableCellContainer(ContainerType<? extends MEPortableCellContainer> type, int id,
final PlayerInventory ip, final IPortableCell monitorable) {
super(type, id, ip, monitorable, false);
if (monitorable instanceof IInventorySlotAware) {
final int slotIndex = ((IInventorySlotAware) monitorable).getInventorySlot();
@@ -35,21 +35,21 @@ import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.AppEngSlot;
import appeng.container.slot.SlotMolecularAssemblerPattern;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.items.misc.ItemEncodedPattern;
import appeng.tile.crafting.TileMolecularAssembler;
import appeng.container.slot.MolecularAssemblerPatternSlot;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.items.misc.EncodedPatternItem;
import appeng.tile.crafting.MolecularAssemblerTileEntity;
import appeng.util.Platform;
public class ContainerMolecularAssembler extends ContainerUpgradeable implements IProgressProvider {
public class MolecularAssemblerContainer extends UpgradeableContainer implements IProgressProvider {
public static ContainerType<ContainerMolecularAssembler> TYPE;
public static ContainerType<MolecularAssemblerContainer> TYPE;
private static final ContainerHelper<ContainerMolecularAssembler, TileMolecularAssembler> helper = new ContainerHelper<>(
ContainerMolecularAssembler::new, TileMolecularAssembler.class);
private static final ContainerHelper<MolecularAssemblerContainer, MolecularAssemblerTileEntity> helper = new ContainerHelper<>(
MolecularAssemblerContainer::new, MolecularAssemblerTileEntity.class);
public static ContainerMolecularAssembler fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MolecularAssemblerContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -58,28 +58,28 @@ public class ContainerMolecularAssembler extends ContainerUpgradeable implements
}
private static final int MAX_CRAFT_PROGRESS = 100;
private final TileMolecularAssembler tma;
private final MolecularAssemblerTileEntity tma;
@GuiSync(4)
public int craftProgress = 0;
private Slot encodedPatternSlot;
public ContainerMolecularAssembler(int id, final PlayerInventory ip, final TileMolecularAssembler te) {
public MolecularAssemblerContainer(int id, final PlayerInventory ip, final MolecularAssemblerTileEntity te) {
super(TYPE, id, ip, te);
this.tma = te;
}
public boolean isValidItemForSlot(final int slotIndex, final ItemStack i) {
final IItemHandler mac = this.getUpgradeable().getInventoryByName(TileMolecularAssembler.INVENTORY_MAIN);
final IItemHandler mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
final ItemStack is = mac.getStackInSlot(10);
if (is.isEmpty()) {
return false;
}
if (is.getItem() instanceof ItemEncodedPattern) {
if (is.getItem() instanceof EncodedPatternItem) {
final World w = this.getTileEntity().getWorld();
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
final EncodedPatternItem iep = (EncodedPatternItem) is.getItem();
final ICraftingPatternDetails ph = iep.getPatternForItem(is, w);
if (ph.isCraftable()) {
return ph.isValidItemForSlot(slotIndex, i, w);
@@ -99,11 +99,11 @@ public class ContainerMolecularAssembler extends ContainerUpgradeable implements
int offX = 29;
int offY = 30;
final IItemHandler mac = this.getUpgradeable().getInventoryByName(TileMolecularAssembler.INVENTORY_MAIN);
final IItemHandler mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
final SlotMolecularAssemblerPattern s = new SlotMolecularAssemblerPattern(this, mac, x + y * 3,
final MolecularAssemblerPatternSlot s = new MolecularAssemblerPatternSlot(this, mac, x + y * 3,
offX + x * 18, offY + y * 18);
this.addSlot(s);
}
@@ -113,23 +113,23 @@ public class ContainerMolecularAssembler extends ContainerUpgradeable implements
offY = 16;
encodedPatternSlot = this
.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10,
.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10,
offX, offY, this.getPlayerInventory()));
this.addSlot(new SlotOutput(mac, 9, offX, offY + 32, -1));
this.addSlot(new OutputSlot(mac, 9, offX, offY + 32, -1));
offX = 122;
offY = 17;
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 3, 187,
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 4, 187,
8 + 18 * 4, this.getPlayerInventory())).setNotDraggable());
}
@@ -42,18 +42,18 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.core.sync.packets.MEInventoryUpdatePacket;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
public class ContainerNetworkStatus extends AEBaseContainer {
public class NetworkStatusContainer extends AEBaseContainer {
public static ContainerType<ContainerNetworkStatus> TYPE;
public static ContainerType<NetworkStatusContainer> TYPE;
private static final ContainerHelper<ContainerNetworkStatus, INetworkTool> helper = new ContainerHelper<>(
ContainerNetworkStatus::new, INetworkTool.class);
private static final ContainerHelper<NetworkStatusContainer, INetworkTool> helper = new ContainerHelper<>(
NetworkStatusContainer::new, INetworkTool.class);
public static ContainerNetworkStatus fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static NetworkStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -72,7 +72,7 @@ public class ContainerNetworkStatus extends AEBaseContainer {
private IGrid network;
private int delay = 40;
public ContainerNetworkStatus(int id, PlayerInventory ip, final INetworkTool te) {
public NetworkStatusContainer(int id, PlayerInventory ip, final INetworkTool te) {
super(TYPE, id, ip, null, null);
final IGridHost host = te.getGridHost();
@@ -112,7 +112,7 @@ public class ContainerNetworkStatus extends AEBaseContainer {
}
try {
final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
final MEInventoryUpdatePacket piu = new MEInventoryUpdatePacket();
for (final Class<? extends IGridHost> machineClass : this.network.getMachinesClasses()) {
final IItemList<IAEItemStack> list = AEApi.instance().storage()
@@ -29,16 +29,16 @@ import appeng.api.implementations.guiobjects.INetworkTool;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.RestrictedInputSlot;
public class ContainerNetworkTool extends AEBaseContainer {
public class NetworkToolContainer extends AEBaseContainer {
public static ContainerType<ContainerNetworkTool> TYPE;
public static ContainerType<NetworkToolContainer> TYPE;
private static final ContainerHelper<ContainerNetworkTool, INetworkTool> helper = new ContainerHelper<>(
ContainerNetworkTool::new, INetworkTool.class);
private static final ContainerHelper<NetworkToolContainer, INetworkTool> helper = new ContainerHelper<>(
NetworkToolContainer::new, INetworkTool.class);
public static ContainerNetworkTool fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static NetworkToolContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -51,7 +51,7 @@ public class ContainerNetworkTool extends AEBaseContainer {
@GuiSync(1)
public boolean facadeMode;
public ContainerNetworkTool(int id, final PlayerInventory ip, final INetworkTool te) {
public NetworkToolContainer(int id, final PlayerInventory ip, final INetworkTool te) {
super(TYPE, id, ip, null, null);
this.toolInv = te;
@@ -59,7 +59,7 @@ public class ContainerNetworkTool extends AEBaseContainer {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, te.getInventory(),
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, te.getInventory(),
y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, this.getPlayerInventory())));
}
}
@@ -55,16 +55,16 @@ import appeng.container.ContainerLocator;
import appeng.container.ContainerNull;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.IOptionalSlotHost;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.container.slot.SlotPatternOutputs;
import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotRestrictedInput;
import appeng.core.sync.packets.PacketPatternSlot;
import appeng.container.slot.OptionalFakeSlot;
import appeng.container.slot.FakeCraftingMatrixSlot;
import appeng.container.slot.PatternOutputsSlot;
import appeng.container.slot.PatternTermSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.core.sync.packets.PatternSlotPacket;
import appeng.helpers.IContainerCraftingPacket;
import appeng.items.storage.ItemViewCell;
import appeng.items.storage.ViewCellItem;
import appeng.me.helpers.MachineSource;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.parts.reporting.PatternTerminalPart;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
@@ -74,15 +74,15 @@ import appeng.util.inv.InvOperation;
import appeng.util.inv.WrapperCursorItemHandler;
import appeng.util.item.AEItemStack;
public class ContainerPatternTerm extends ContainerMEMonitorable
public class PatternTermContainer extends MEMonitorableContainer
implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket {
public static ContainerType<ContainerPatternTerm> TYPE;
public static ContainerType<PatternTermContainer> TYPE;
private static final ContainerHelper<ContainerPatternTerm, ITerminalHost> helper = new ContainerHelper<>(
ContainerPatternTerm::new, ITerminalHost.class, SecurityPermissions.CRAFT);
private static final ContainerHelper<PatternTermContainer, ITerminalHost> helper = new ContainerHelper<>(
PatternTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static ContainerPatternTerm fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static PatternTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -90,14 +90,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
return helper.open(player, locator);
}
private final PartPatternTerminal patternTerminal;
private final PatternTerminalPart patternTerminal;
private final AppEngInternalInventory cOut = new AppEngInternalInventory(null, 1);
private final IItemHandler crafting;
private final SlotFakeCraftingMatrix[] craftingSlots = new SlotFakeCraftingMatrix[9];
private final OptionalSlotFake[] outputSlots = new OptionalSlotFake[3];
private final SlotPatternTerm craftSlot;
private final SlotRestrictedInput patternSlotIN;
private final SlotRestrictedInput patternSlotOUT;
private final FakeCraftingMatrixSlot[] craftingSlots = new FakeCraftingMatrixSlot[9];
private final OptionalFakeSlot[] outputSlots = new OptionalFakeSlot[3];
private final PatternTermSlot craftSlot;
private final RestrictedInputSlot patternSlotIN;
private final RestrictedInputSlot patternSlotOUT;
private IRecipe<CraftingInventory> currentRecipe;
@GuiSync(97)
@@ -105,9 +105,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
@GuiSync(96)
public boolean substitute = false;
public ContainerPatternTerm(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
public PatternTermContainer(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
super(TYPE, id, ip, monitorable, false);
this.patternTerminal = (PartPatternTerminal) monitorable;
this.patternTerminal = (PatternTerminalPart) monitorable;
final IItemHandler patternInv = this.getPatternTerminal().getInventoryByName("pattern");
final IItemHandler output = this.getPatternTerminal().getInventoryByName("output");
@@ -116,24 +116,24 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
this.addSlot(this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix(this.crafting, x + y * 3,
this.addSlot(this.craftingSlots[x + y * 3] = new FakeCraftingMatrixSlot(this.crafting, x + y * 3,
18 + x * 18, -76 + y * 18));
}
}
this.addSlot(this.craftSlot = new SlotPatternTerm(ip.player, this.getActionSource(), this.getPowerSource(),
this.addSlot(this.craftSlot = new PatternTermSlot(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.addSlot(this.outputSlots[y] = new SlotPatternOutputs(output, this, y, 110, -76 + y * 18, 0, 0, 1));
this.addSlot(this.outputSlots[y] = new PatternOutputsSlot(output, this, y, 110, -76 + y * 18, 0, 0, 1));
this.outputSlots[y].setRenderDisabled(false);
this.outputSlots[y].setIIcon(-1);
}
this.addSlot(this.patternSlotIN = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.BLANK_PATTERN,
this.addSlot(this.patternSlotIN = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.BLANK_PATTERN,
patternInv, 0, 147, -72 - 9, this.getPlayerInventory()));
this.addSlot(this.patternSlotOUT = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN,
this.addSlot(this.patternSlotOUT = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ENCODED_PATTERN,
patternInv, 1, 147, -72 + 34, this.getPlayerInventory()));
this.patternSlotOUT.setStackLimit(1);
@@ -285,7 +285,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
final List<ItemStack> list = new ArrayList<>(3);
boolean hasValue = false;
for (final OptionalSlotFake outputSlot : this.outputSlots) {
for (final OptionalFakeSlot outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() > 0) {
@@ -336,7 +336,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
}
}
public void craftOrGetItem(final PacketPatternSlot packetPatternSlot) {
public void craftOrGetItem(final PatternSlotPacket packetPatternSlot) {
if (packetPatternSlot.slotItem != null && this.getCellInventory() != null) {
final IAEItemStack out = packetPatternSlot.slotItem.copy();
InventoryAdaptor inv = new AdaptorItemHandler(
@@ -389,7 +389,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
if (!ic.getStackInSlot(x).isEmpty()) {
final ItemStack pulled = Platform.extractItemsByRecipe(this.getPowerSource(),
this.getActionSource(), storage, p.world, r, is, ic, ic.getStackInSlot(x), x, all,
Actionable.MODULATE, ItemViewCell.createFilter(this.getViewCells()));
Actionable.MODULATE, ViewCellItem.createFilter(this.getViewCells()));
real.setInventorySlotContents(x, pulled);
}
}
@@ -457,7 +457,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
if (s == this.patternSlotOUT && Platform.isServer()) {
for (final IContainerListener listener : this.listeners) {
for (final Slot slot : this.inventorySlots) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
if (slot instanceof OptionalFakeSlot || slot instanceof FakeCraftingMatrixSlot) {
listener.sendSlotContents(this, slot.slotNumber, slot.getStack());
}
}
@@ -514,7 +514,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable
this.craftingMode = craftingMode;
}
public PartPatternTerminal getPatternTerminal() {
public PatternTerminalPart getPatternTerminal() {
return this.patternTerminal;
}
@@ -35,14 +35,14 @@ import appeng.container.guisync.GuiSync;
import appeng.helpers.IPriorityHost;
import appeng.util.Platform;
public class ContainerPriority extends AEBaseContainer {
public class PriorityContainer extends AEBaseContainer {
public static ContainerType<ContainerPriority> TYPE;
public static ContainerType<PriorityContainer> TYPE;
private static final ContainerHelper<ContainerPriority, IPriorityHost> helper = new ContainerHelper<>(
ContainerPriority::new, IPriorityHost.class, SecurityPermissions.BUILD);
private static final ContainerHelper<PriorityContainer, IPriorityHost> helper = new ContainerHelper<>(
PriorityContainer::new, IPriorityHost.class, SecurityPermissions.BUILD);
public static ContainerPriority fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static PriorityContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -57,7 +57,7 @@ public class ContainerPriority extends AEBaseContainer {
@GuiSync(2)
public long PriorityValue = -1;
public ContainerPriority(int id, final PlayerInventory ip, final IPriorityHost te) {
public PriorityContainer(int id, final PlayerInventory ip, final IPriorityHost te) {
super(TYPE, id, ip, (TileEntity) (te instanceof TileEntity ? te : null),
(IPart) (te instanceof IPart ? te : null));
this.priHost = te;
@@ -26,17 +26,17 @@ import net.minecraft.network.PacketBuffer;
import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.qnb.TileQuantumBridge;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.qnb.QuantumBridgeTileEntity;
public class ContainerQNB extends AEBaseContainer {
public class QNBContainer extends AEBaseContainer {
public static ContainerType<ContainerQNB> TYPE;
public static ContainerType<QNBContainer> TYPE;
private static final ContainerHelper<ContainerQNB, TileQuantumBridge> helper = new ContainerHelper<>(
ContainerQNB::new, TileQuantumBridge.class, SecurityPermissions.BUILD);
private static final ContainerHelper<QNBContainer, QuantumBridgeTileEntity> helper = new ContainerHelper<>(
QNBContainer::new, QuantumBridgeTileEntity.class, SecurityPermissions.BUILD);
public static ContainerQNB fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static QNBContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -44,10 +44,10 @@ public class ContainerQNB extends AEBaseContainer {
return helper.open(player, locator);
}
public ContainerQNB(int id, final PlayerInventory ip, final TileQuantumBridge quantumBridge) {
public QNBContainer(int id, final PlayerInventory ip, final QuantumBridgeTileEntity quantumBridge) {
super(TYPE, id, ip, quantumBridge, null);
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.QE_SINGULARITY,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.QE_SINGULARITY,
quantumBridge.getInternalInventory(), 0, 80, 37, this.getPlayerInventory())).setStackLimit(1));
this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */82);
@@ -33,21 +33,21 @@ import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.items.contents.QuartzKnifeObj;
import appeng.items.materials.ItemMaterial;
import appeng.items.materials.MaterialItem;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.Platform;
public class ContainerQuartzKnife extends AEBaseContainer {
public class QuartzKnifeContainer extends AEBaseContainer {
public static ContainerType<ContainerQuartzKnife> TYPE;
public static ContainerType<QuartzKnifeContainer> TYPE;
private static final ContainerHelper<ContainerQuartzKnife, QuartzKnifeObj> helper = new ContainerHelper<>(
ContainerQuartzKnife::new, QuartzKnifeObj.class);
private static final ContainerHelper<QuartzKnifeContainer, QuartzKnifeObj> helper = new ContainerHelper<>(
QuartzKnifeContainer::new, QuartzKnifeObj.class);
public static ContainerQuartzKnife fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static QuartzKnifeContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -60,12 +60,12 @@ public class ContainerQuartzKnife extends AEBaseContainer {
private final IItemHandler inSlot = new AppEngInternalInventory(null, 1, 1);
private String myName = "";
public ContainerQuartzKnife(int id, final PlayerInventory ip, final QuartzKnifeObj te) {
public QuartzKnifeContainer(int id, final PlayerInventory ip, final QuartzKnifeObj te) {
super(TYPE, id, ip, null, null);
this.toolInv = te;
this.addSlot(
new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip));
new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip));
this.addSlot(new QuartzKniveSlot(this.inSlot, 0, 134, 44, -1));
this.lockPlayerInventorySlot(ip.currentItem);
@@ -104,7 +104,7 @@ public class ContainerQuartzKnife extends AEBaseContainer {
}
}
private class QuartzKniveSlot extends SlotOutput {
private class QuartzKniveSlot extends OutputSlot {
QuartzKniveSlot(IItemHandler a, int b, int c, int d, int i) {
super(a, b, c, d, i);
}
@@ -117,11 +117,11 @@ public class ContainerQuartzKnife extends AEBaseContainer {
return ItemStack.EMPTY;
}
if (SlotRestrictedInput.isMetalIngot(input)) {
if (ContainerQuartzKnife.this.myName.length() > 0) {
if (RestrictedInputSlot.isMetalIngot(input)) {
if (QuartzKnifeContainer.this.myName.length() > 0) {
return AEApi.instance().definitions().materials().namePress().maybeStack(1).map(namePressStack -> {
final CompoundNBT compound = namePressStack.getOrCreateTag();
compound.putString(ItemMaterial.TAG_INSCRIBE_NAME, ContainerQuartzKnife.this.myName);
compound.putString(MaterialItem.TAG_INSCRIBE_NAME, QuartzKnifeContainer.this.myName);
return namePressStack;
}).orElse(ItemStack.EMPTY);
@@ -150,16 +150,16 @@ public class ContainerQuartzKnife extends AEBaseContainer {
private void makePlate() {
if (Platform.isServer()) {
if (!this.getItemHandler().extractItem(0, 1, false).isEmpty()) {
final ItemStack item = ContainerQuartzKnife.this.toolInv.getItemStack();
final ItemStack item = QuartzKnifeContainer.this.toolInv.getItemStack();
final ItemStack before = item.copy();
item.damageItem(1, ContainerQuartzKnife.this.getPlayerInv().player, p -> {
ContainerQuartzKnife.this.getPlayerInv().setInventorySlotContents(
ContainerQuartzKnife.this.getPlayerInv().currentItem, ItemStack.EMPTY);
item.damageItem(1, QuartzKnifeContainer.this.getPlayerInv().player, p -> {
QuartzKnifeContainer.this.getPlayerInv().setInventorySlotContents(
QuartzKnifeContainer.this.getPlayerInv().currentItem, ItemStack.EMPTY);
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(
ContainerQuartzKnife.this.getPlayerInv().player, before, null));
QuartzKnifeContainer.this.getPlayerInv().player, before, null));
});
ContainerQuartzKnife.this.detectAndSendChanges();
QuartzKnifeContainer.this.detectAndSendChanges();
}
}
}
@@ -34,47 +34,47 @@ import appeng.api.implementations.items.IBiometricCard;
import appeng.api.storage.ITerminalHost;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.misc.TileSecurityStation;
import appeng.tile.misc.SecurityStationTileEntity;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
public class ContainerSecurityStation extends ContainerMEMonitorable implements IAEAppEngInventory {
public class SecurityStationContainer extends MEMonitorableContainer implements IAEAppEngInventory {
public static ContainerType<ContainerSecurityStation> TYPE;
public static ContainerType<SecurityStationContainer> TYPE;
private static final ContainerHelper<ContainerSecurityStation, ITerminalHost> helper = new ContainerHelper<>(
ContainerSecurityStation::new, ITerminalHost.class, SecurityPermissions.SECURITY);
private static final ContainerHelper<SecurityStationContainer, ITerminalHost> helper = new ContainerHelper<>(
SecurityStationContainer::new, ITerminalHost.class, SecurityPermissions.SECURITY);
private final SlotRestrictedInput configSlot;
private final RestrictedInputSlot configSlot;
private final AppEngInternalInventory wirelessEncoder = new AppEngInternalInventory(this, 2);
private final SlotRestrictedInput wirelessIn;
private final SlotOutput wirelessOut;
private final RestrictedInputSlot wirelessIn;
private final OutputSlot wirelessOut;
private final TileSecurityStation securityBox;
private final SecurityStationTileEntity securityBox;
@GuiSync(0)
public int permissionMode = 0;
public ContainerSecurityStation(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
public SecurityStationContainer(int id, final PlayerInventory ip, final ITerminalHost monitorable) {
super(TYPE, id, ip, monitorable, false);
this.securityBox = (TileSecurityStation) monitorable;
this.securityBox = (SecurityStationTileEntity) monitorable;
this.addSlot(this.configSlot = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD,
this.addSlot(this.configSlot = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.BIOMETRIC_CARD,
this.securityBox.getConfigSlot(), 0, 37, -33, ip));
this.addSlot(this.wirelessIn = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM,
this.addSlot(this.wirelessIn = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ENCODABLE_ITEM,
this.wirelessEncoder, 0, 212, 10, ip));
this.addSlot(this.wirelessOut = new SlotOutput(this.wirelessEncoder, 1, 212, 68, -1));
this.addSlot(this.wirelessOut = new OutputSlot(this.wirelessEncoder, 1, 212, 68, -1));
this.bindPlayerInventory(ip, 0, 0);
}
public static ContainerSecurityStation fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SecurityStationContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -25,25 +25,25 @@ import net.minecraft.network.PacketBuffer;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.slot.SlotNormal;
import appeng.tile.storage.TileSkyChest;
import appeng.container.slot.NormalSlot;
import appeng.tile.storage.SkyChestTileEntity;
public class ContainerSkyChest extends AEBaseContainer {
public class SkyChestContainer extends AEBaseContainer {
public static ContainerType<ContainerSkyChest> TYPE;
public static ContainerType<SkyChestContainer> TYPE;
private static final ContainerHelper<ContainerSkyChest, TileSkyChest> helper = new ContainerHelper<>(
ContainerSkyChest::new, TileSkyChest.class);
private static final ContainerHelper<SkyChestContainer, SkyChestTileEntity> helper = new ContainerHelper<>(
SkyChestContainer::new, SkyChestTileEntity.class);
private final TileSkyChest chest;
private final SkyChestTileEntity chest;
public ContainerSkyChest(int id, final PlayerInventory ip, final TileSkyChest chest) {
public SkyChestContainer(int id, final PlayerInventory ip, final SkyChestTileEntity chest) {
super(TYPE, id, ip, chest, null);
this.chest = chest;
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 9; x++) {
this.addSlot(new SlotNormal(this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y));
this.addSlot(new NormalSlot(this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y));
}
}
@@ -52,7 +52,7 @@ public class ContainerSkyChest extends AEBaseContainer {
this.bindPlayerInventory(ip, 0, 195 - /* height of player inventory */82);
}
public static ContainerSkyChest fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SkyChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -32,17 +32,17 @@ import appeng.api.util.DimensionalCoord;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.container.slot.OutputSlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.spatial.SpatialIOPortTileEntity;
import appeng.util.Platform;
public class ContainerSpatialIOPort extends AEBaseContainer {
public class SpatialIOPortContainer extends AEBaseContainer {
public static ContainerType<ContainerSpatialIOPort> TYPE;
public static ContainerType<SpatialIOPortContainer> TYPE;
private static final ContainerHelper<ContainerSpatialIOPort, TileSpatialIOPort> helper = new ContainerHelper<>(
ContainerSpatialIOPort::new, TileSpatialIOPort.class, SecurityPermissions.BUILD);
private static final ContainerHelper<SpatialIOPortContainer, SpatialIOPortTileEntity> helper = new ContainerHelper<>(
SpatialIOPortContainer::new, SpatialIOPortTileEntity.class, SecurityPermissions.BUILD);
@GuiSync(0)
public long currentPower;
@@ -62,22 +62,22 @@ public class ContainerSpatialIOPort extends AEBaseContainer {
@GuiSync(33)
public int zSize;
public ContainerSpatialIOPort(int id, final PlayerInventory ip, final TileSpatialIOPort spatialIOPort) {
public SpatialIOPortContainer(int id, final PlayerInventory ip, final SpatialIOPortTileEntity spatialIOPort) {
super(TYPE, id, ip, spatialIOPort, null);
if (Platform.isServer()) {
this.network = spatialIOPort.getGridNode(AEPartLocation.INTERNAL).getGrid();
}
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.SPATIAL_STORAGE_CELLS,
spatialIOPort.getInternalInventory(), 0, 52, 48, this.getPlayerInventory()));
this.addSlot(new SlotOutput(spatialIOPort.getInternalInventory(), 1, 113, 48,
SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon));
this.addSlot(new OutputSlot(spatialIOPort.getInternalInventory(), 1, 113, 48,
RestrictedInputSlot.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon));
this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */82);
}
public static ContainerSpatialIOPort fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SpatialIOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -40,22 +40,22 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.OptionalSlotFakeTypeOnly;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.parts.misc.PartStorageBus;
import appeng.container.slot.OptionalTypeOnlyFakeSlot;
import appeng.container.slot.FakeTypeOnlySlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.parts.misc.StorageBusPart;
import appeng.util.Platform;
import appeng.util.helpers.ItemHandlerUtil;
import appeng.util.iterators.NullIterator;
public class ContainerStorageBus extends ContainerUpgradeable {
public class StorageBusContainer extends UpgradeableContainer {
public static ContainerType<ContainerStorageBus> TYPE;
public static ContainerType<StorageBusContainer> TYPE;
private static final ContainerHelper<ContainerStorageBus, PartStorageBus> helper = new ContainerHelper<>(
ContainerStorageBus::new, PartStorageBus.class, SecurityPermissions.BUILD);
private static final ContainerHelper<StorageBusContainer, StorageBusPart> helper = new ContainerHelper<>(
StorageBusContainer::new, StorageBusPart.class, SecurityPermissions.BUILD);
public static ContainerStorageBus fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static StorageBusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -63,7 +63,7 @@ public class ContainerStorageBus extends ContainerUpgradeable {
return helper.open(player, locator);
}
private final PartStorageBus storageBus;
private final StorageBusPart storageBus;
@GuiSync(3)
public AccessRestriction rwMode = AccessRestriction.READ_WRITE;
@@ -71,7 +71,7 @@ public class ContainerStorageBus extends ContainerUpgradeable {
@GuiSync(4)
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;
public ContainerStorageBus(int id, final PlayerInventory ip, final PartStorageBus te) {
public StorageBusContainer(int id, final PlayerInventory ip, final StorageBusPart te) {
super(TYPE, id, ip, te);
this.storageBus = te;
}
@@ -90,23 +90,23 @@ public class ContainerStorageBus extends ContainerUpgradeable {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 9; x++) {
if (y < 2) {
this.addSlot(new SlotFakeTypeOnly(config, y * 9 + x, xo + x * 18, yo + y * 18));
this.addSlot(new FakeTypeOnlySlot(config, y * 9 + x, xo + x * 18, yo + y * 18));
} else {
this.addSlot(new OptionalSlotFakeTypeOnly(config, this, y * 9 + x, xo, yo, x, y, y - 2));
this.addSlot(new OptionalTypeOnlyFakeSlot(config, this, y * 9 + x, xo, yo, x, y, y - 2));
}
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 3, 187,
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 4, 187,
8 + 18 * 4, this.getPlayerInventory())).setNotDraggable());
}
@@ -44,23 +44,23 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.IOptionalSlotHost;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.OptionalSlotFakeTypeOnly;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.OptionalFakeSlot;
import appeng.container.slot.OptionalTypeOnlyFakeSlot;
import appeng.container.slot.FakeTypeOnlySlot;
import appeng.container.slot.RestrictedInputSlot;
import appeng.items.contents.NetworkToolViewer;
import appeng.items.tools.ToolNetworkTool;
import appeng.parts.automation.PartExportBus;
import appeng.items.tools.NetworkToolItem;
import appeng.parts.automation.ExportBusPart;
import appeng.util.Platform;
public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSlotHost {
public class UpgradeableContainer extends AEBaseContainer implements IOptionalSlotHost {
public static ContainerType<ContainerUpgradeable> TYPE;
public static ContainerType<UpgradeableContainer> TYPE;
private static final ContainerHelper<ContainerUpgradeable, IUpgradeableHost> helper = new ContainerHelper<>(
ContainerUpgradeable::new, IUpgradeableHost.class, SecurityPermissions.BUILD);
private static final ContainerHelper<UpgradeableContainer, IUpgradeableHost> helper = new ContainerHelper<>(
UpgradeableContainer::new, IUpgradeableHost.class, SecurityPermissions.BUILD);
public static ContainerUpgradeable fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static UpgradeableContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -80,12 +80,12 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
private int tbSlot;
private NetworkToolViewer tbInventory;
public ContainerUpgradeable(int id, final PlayerInventory ip, final IUpgradeableHost te) {
public UpgradeableContainer(int id, final PlayerInventory ip, final IUpgradeableHost te) {
this(TYPE, id, ip, te);
}
public ContainerUpgradeable(ContainerType<?> containerType, int id, final PlayerInventory ip,
final IUpgradeableHost te) {
public UpgradeableContainer(ContainerType<?> containerType, int id, final PlayerInventory ip,
final IUpgradeableHost te) {
super(containerType, id, ip, (TileEntity) (te instanceof TileEntity ? te : null),
(IPart) (te instanceof IPart ? te : null));
this.upgradeable = te;
@@ -114,7 +114,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
final IInventory pi = this.getPlayerInv();
for (int x = 0; x < pi.getSizeInventory(); x++) {
final ItemStack pii = pi.getStackInSlot(x);
if (!pii.isEmpty() && pii.getItem() instanceof ToolNetworkTool) {
if (!pii.isEmpty() && pii.getItem() instanceof NetworkToolItem) {
this.lockPlayerInventorySlot(x);
this.tbSlot = x;
this.tbInventory = (NetworkToolViewer) ((IGuiItem) pii.getItem()).getGuiObject(pii, x, w,
@@ -126,7 +126,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
if (this.hasToolbox()) {
for (int v = 0; v < 3; v++) {
for (int u = 0; u < 3; u++) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES,
this.tbInventory.getInternalInventory(), u + v * 3, 186 + u * 18,
this.getHeight() - 82 + v * 18, this.getPlayerInventory())).setPlayerSide());
}
@@ -152,37 +152,37 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final int y = 40;
final int x = 80;
this.addSlot(new SlotFakeTypeOnly(inv, 0, x, y));
this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y));
if (this.supportCapacity()) {
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.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 1, x, y, -1, 0, 1));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 2, x, y, 1, 0, 1));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 3, x, y, 0, -1, 1));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 4, x, y, 0, 1, 1));
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));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 5, x, y, -1, -1, 2));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 6, x, y, 1, -1, 2));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 7, x, y, -1, 1, 2));
this.addSlot(new OptionalTypeOnlyFakeSlot(inv, this, 8, x, y, 1, 1, 2));
}
}
protected void setupUpgrades() {
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
if (this.availableUpgrades() > 0) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 1) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187,
8 + 18, this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 2) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 2, 187,
8 + 18 * 2, this.getPlayerInventory())).setNotDraggable());
}
if (this.availableUpgrades() > 3) {
this.addSlot((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187,
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 3, 187,
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
}
}
@@ -207,8 +207,8 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
this.checkToolbox();
for (final Object o : this.inventorySlots) {
if (o instanceof OptionalSlotFake) {
final OptionalSlotFake fs = (OptionalSlotFake) o;
if (o instanceof OptionalFakeSlot) {
final OptionalFakeSlot fs = (OptionalFakeSlot) o;
if (!fs.isSlotEnabled() && !fs.getDisplayStack().isEmpty()) {
fs.clearStack();
}
@@ -221,7 +221,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
protected void loadSettingsFromHost(final IConfigManager cm) {
this.setFuzzyMode((FuzzyMode) cm.getSetting(Settings.FUZZY_MODE));
this.setRedStoneMode((RedstoneMode) cm.getSetting(Settings.REDSTONE_CONTROLLED));
if (this.getUpgradeable() instanceof PartExportBus) {
if (this.getUpgradeable() instanceof ExportBusPart) {
this.setCraftingMode((YesNo) cm.getSetting(Settings.CRAFT_ONLY));
this.setSchedulingMode((SchedulingMode) cm.getSetting(Settings.SCHEDULING_MODE));
}
@@ -27,18 +27,18 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.misc.TileVibrationChamber;
import appeng.container.slot.RestrictedInputSlot;
import appeng.tile.misc.VibrationChamberTileEntity;
import appeng.util.Platform;
public class ContainerVibrationChamber extends AEBaseContainer implements IProgressProvider {
public class VibrationChamberContainer extends AEBaseContainer implements IProgressProvider {
public static ContainerType<ContainerVibrationChamber> TYPE;
public static ContainerType<VibrationChamberContainer> TYPE;
private static final ContainerHelper<ContainerVibrationChamber, TileVibrationChamber> helper = new ContainerHelper<>(
ContainerVibrationChamber::new, TileVibrationChamber.class);
private static final ContainerHelper<VibrationChamberContainer, VibrationChamberTileEntity> helper = new ContainerHelper<>(
VibrationChamberContainer::new, VibrationChamberTileEntity.class);
public static ContainerVibrationChamber fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static VibrationChamberContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -46,17 +46,17 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr
return helper.open(player, locator);
}
private final TileVibrationChamber vibrationChamber;
private final VibrationChamberTileEntity vibrationChamber;
@GuiSync(0)
public int burnSpeed = 0;
@GuiSync(1)
public int remainingBurnTime = 0;
public ContainerVibrationChamber(int id, final PlayerInventory ip, final TileVibrationChamber vibrationChamber) {
public VibrationChamberContainer(int id, final PlayerInventory ip, final VibrationChamberTileEntity vibrationChamber) {
super(TYPE, id, ip, vibrationChamber, null);
this.vibrationChamber = vibrationChamber;
this.addSlot(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.FUEL,
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.FUEL,
vibrationChamber.getInternalInventory(), 0, 80, 37, this.getPlayerInventory()));
this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */82);
@@ -84,6 +84,6 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr
@Override
public int getMaxProgress() {
return TileVibrationChamber.MAX_BURN_SPEED;
return VibrationChamberTileEntity.MAX_BURN_SPEED;
}
}
@@ -27,18 +27,18 @@ import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.RestrictedInputSlot;
import appeng.core.AEConfig;
import appeng.tile.networking.TileWireless;
import appeng.tile.networking.WirelessTileEntity;
public class ContainerWireless extends AEBaseContainer {
public class WirelessContainer extends AEBaseContainer {
public static ContainerType<ContainerWireless> TYPE;
public static ContainerType<WirelessContainer> TYPE;
private static final ContainerHelper<ContainerWireless, TileWireless> helper = new ContainerHelper<>(
ContainerWireless::new, TileWireless.class, SecurityPermissions.BUILD);
private static final ContainerHelper<WirelessContainer, WirelessTileEntity> helper = new ContainerHelper<>(
WirelessContainer::new, WirelessTileEntity.class, SecurityPermissions.BUILD);
public static ContainerWireless fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static WirelessContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -46,16 +46,16 @@ public class ContainerWireless extends AEBaseContainer {
return helper.open(player, locator);
}
private final SlotRestrictedInput boosterSlot;
private final RestrictedInputSlot boosterSlot;
@GuiSync(1)
public long range = 0;
@GuiSync(2)
public long drain = 0;
public ContainerWireless(int id, final PlayerInventory ip, final TileWireless te) {
public WirelessContainer(int id, final PlayerInventory ip, final WirelessTileEntity te) {
super(TYPE, id, ip, te, null);
this.addSlot(this.boosterSlot = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER,
this.addSlot(this.boosterSlot = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.RANGE_BOOSTER,
te.getInternalInventory(), 0, 80, 47, this.getPlayerInventory()));
this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */82);
@@ -29,14 +29,14 @@ import appeng.core.localization.PlayerMessages;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.util.Platform;
public class ContainerWirelessTerm extends ContainerMEPortableCell {
public class WirelessTermContainer extends MEPortableCellContainer {
public static ContainerType<ContainerWirelessTerm> TYPE;
public static ContainerType<WirelessTermContainer> TYPE;
private static final ContainerHelper<ContainerWirelessTerm, WirelessTerminalGuiObject> helper = new ContainerHelper<>(
ContainerWirelessTerm::new, WirelessTerminalGuiObject.class);
private static final ContainerHelper<WirelessTermContainer, WirelessTerminalGuiObject> helper = new ContainerHelper<>(
WirelessTermContainer::new, WirelessTerminalGuiObject.class);
public static ContainerWirelessTerm fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static WirelessTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -46,7 +46,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell {
private final WirelessTerminalGuiObject wirelessTerminalGUIObject;
public ContainerWirelessTerm(int id, final PlayerInventory ip, final WirelessTerminalGuiObject gui) {
public WirelessTermContainer(int id, final PlayerInventory ip, final WirelessTerminalGuiObject gui) {
super(TYPE, id, ip, gui);
this.wirelessTerminalGUIObject = gui;
}