API compiles

This commit is contained in:
Sebastian Hartte
2020-06-27 18:09:44 +02:00
parent ba71a82288
commit 80fbb58d4f
572 changed files with 2995 additions and 3037 deletions
@@ -24,6 +24,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
@@ -33,8 +35,6 @@ import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import appeng.api.AEApi;
@@ -81,7 +81,7 @@ public abstract class AEBaseContainer extends Container {
private final PlayerInventory invPlayer;
private final IActionSource mySrc;
private final HashSet<Integer> locked = new HashSet<>();
private final TileEntity tileEntity;
private final BlockEntity tileEntity;
private final IPart part;
private final IGuiItemObject obj;
private final HashMap<Integer, SyncData> syncData = new HashMap<>();
@@ -96,12 +96,12 @@ public abstract class AEBaseContainer extends Container {
// Slots that were created to represent the player inventory
private List<Slot> playerInventorySlots = null;
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileEntity myTile,
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
final IPart myPart) {
this(containerType, id, ip, myTile, myPart, null);
}
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileEntity myTile,
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
final IPart myPart, final IGuiItemObject gio) {
super(containerType, id);
this.invPlayer = ip;
@@ -115,7 +115,7 @@ public abstract class AEBaseContainer extends Container {
public AEBaseContainer(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object anchor) {
super(containerType, id);
this.invPlayer = ip;
this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null;
this.tileEntity = anchor instanceof BlockEntity ? (BlockEntity) anchor : null;
this.part = anchor instanceof IPart ? (IPart) anchor : null;
this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null;
@@ -242,7 +242,7 @@ public abstract class AEBaseContainer extends Container {
return this.getPlayerInventory();
}
public TileEntity getTileEntity() {
public BlockEntity getTileEntity() {
return this.tileEntity;
}
@@ -262,7 +262,7 @@ public abstract class AEBaseContainer extends Container {
}
protected void bindPlayerInventory(final PlayerInventory PlayerInventory, final int offsetX, final int offsetY) {
IItemHandler ih = new PlayerInvWrapper(PlayerInventory);
ItemTransferable ih = new PlayerInvWrapper(PlayerInventory);
// bind player inventory
for (int i = 0; i < 3; i++) {
@@ -22,11 +22,11 @@ import com.google.common.base.Preconditions;
import io.netty.handler.codec.DecoderException;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
@@ -74,7 +74,7 @@ public final class ContainerLocator {
this.side = side;
}
public static ContainerLocator forTileEntity(TileEntity te) {
public static ContainerLocator forTileEntity(BlockEntity te) {
if (te.getWorld() == null) {
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
}
@@ -82,7 +82,7 @@ public final class ContainerLocator {
return new ContainerLocator(Type.BLOCK, -1, dimensionId, te.getPos(), null);
}
public static ContainerLocator forTileEntitySide(TileEntity te, Direction side) {
public static ContainerLocator forTileEntitySide(BlockEntity te, Direction side) {
if (te.getWorld() == null) {
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
}
@@ -164,7 +164,7 @@ public final class ContainerLocator {
return side;
}
public void write(PacketBuffer buf) {
public void write(PacketByteBuf buf) {
switch (type) {
case PLAYER_INVENTORY:
buf.writeByte(0);
@@ -193,7 +193,7 @@ public final class ContainerLocator {
}
}
public static ContainerLocator read(PacketBuffer buf) {
public static ContainerLocator read(PacketByteBuf buf) {
byte type = buf.readByte();
switch (type) {
case 0:
@@ -25,7 +25,7 @@ import java.util.Objects;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.text.Text;
import appeng.container.AEBaseContainer;
import appeng.core.AELog;
@@ -80,18 +80,18 @@ public class SyncData {
}
private void send(final IContainerListener o, Object val) {
if (fieldType.isAssignableFrom(ITextComponent.class)) {
if (fieldType.isAssignableFrom(Text.class)) {
if (o instanceof ServerPlayerEntity) {
String json = "";
if (val != null) {
json = ITextComponent.Serializer.toJson((ITextComponent) val);
json = Text.Serializer.toJson((Text) val);
}
NetworkHandler.instance().sendTo(new ConfigValuePacket("SyncDat." + this.channel, json),
(ServerPlayerEntity) o);
}
}
// Types other than ITextComponent must be non-null
// Types other than Text must be non-null
if (val == null) {
return;
}
@@ -123,11 +123,11 @@ public class SyncData {
try {
final Object oldValue = this.getter.invoke(source);
if (val instanceof String) {
if (this.fieldType.isAssignableFrom(ITextComponent.class)) {
if (this.fieldType.isAssignableFrom(Text.class)) {
String json = (String) val;
ITextComponent text = null;
Text text = null;
if (!json.isEmpty()) {
text = ITextComponent.Serializer.fromJson((String) val);
text = Text.Serializer.fromJson((String) val);
}
this.updateTextComponent(text);
} else {
@@ -149,7 +149,7 @@ public class SyncData {
}
}
private void updateTextComponent(final ITextComponent val) {
private void updateTextComponent(final Text val) {
try {
this.setter.invoke(source, val);
} catch (Throwable e) {
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import java.util.Iterator;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
@@ -27,8 +28,7 @@ import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import net.minecraftforge.items.wrapper.EmptyHandler;
import appeng.api.AEApi;
@@ -72,7 +72,7 @@ public class CellWorkbenchContainer extends UpgradeableContainer {
this.workBench = te;
}
public static CellWorkbenchContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CellWorkbenchContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -102,11 +102,11 @@ public class CellWorkbenchContainer extends UpgradeableContainer {
@Override
protected void setupConfig() {
final IItemHandler cell = this.getUpgradeable().getInventoryByName("cell");
final ItemTransferable cell = this.getUpgradeable().getInventoryByName("cell");
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8,
this.getPlayerInv()));
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable inv = this.getUpgradeable().getInventoryByName("config");
final WrapperSupplierItemHandler upgradeInventory = new WrapperSupplierItemHandler(
this::getCellUpgradeInventory);
// null, 3 * 8 );
@@ -182,8 +182,8 @@ public class CellWorkbenchContainer extends UpgradeableContainer {
return idx < this.availableUpgrades();
}
public IItemHandler getCellUpgradeInventory() {
final IItemHandler upgradeInventory = this.workBench.getCellUpgradeInventory();
public ItemTransferable getCellUpgradeInventory() {
final ItemTransferable upgradeInventory = this.workBench.getCellUpgradeInventory();
return upgradeInventory == null ? EmptyHandler.INSTANCE : upgradeInventory;
}
@@ -212,7 +212,7 @@ public class CellWorkbenchContainer extends UpgradeableContainer {
public void partition() {
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable inv = this.getUpgradeable().getInventoryByName("config");
final ItemStack is = this.getUpgradeable().getInventoryByName("cell").getStackInSlot(0);
final IStorageChannel channel = is.getItem() instanceof IStorageCell
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
@@ -45,7 +45,7 @@ public class ChestContainer extends AEBaseContainer {
this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */82);
}
public static ChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static ChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -21,8 +21,8 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.config.CondenserOutput;
import appeng.api.config.Settings;
@@ -54,7 +54,7 @@ public class CondenserContainer extends AEBaseContainer implements IProgressProv
super(TYPE, id, ip, condenser, null);
this.condenser = condenser;
IItemHandler inv = condenser.getInternalInventory();
ItemTransferable inv = condenser.getInternalInventory();
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.TRASH, inv, 0, 51, 52, ip));
this.addSlot(new OutputSlot(inv, 1, 105, 52, -1));
@@ -65,7 +65,7 @@ public class CondenserContainer extends AEBaseContainer implements IProgressProv
this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */82);
}
public static CondenserContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CondenserContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -6,12 +6,12 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.inventory.container.SimpleNamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.text.Text;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.text.TranslatableText;
import net.minecraft.world.World;
import net.minecraftforge.fml.network.NetworkHooks;
@@ -58,7 +58,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
* Opens a container that is based around a single tile entity. The tile
* entity's position is encoded in the packet buffer.
*/
public C fromNetwork(int windowId, PlayerInventory inv, PacketBuffer packetBuf) {
public C fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf packetBuf) {
I host = getHostFromLocator(inv.player, ContainerLocator.read(packetBuf));
if (host != null) {
return factory.create(windowId, inv, host);
@@ -83,7 +83,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
return false;
}
ITextComponent title = findContainerTitle(player.world, locator, accessInterface);
Text title = findContainerTitle(player.world, locator, accessInterface);
INamedContainerProvider container = new SimpleNamedContainerProvider((wnd, p, pl) -> {
C c = factory.create(wnd, p, accessInterface);
@@ -97,7 +97,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
return true;
}
private ITextComponent findContainerTitle(World world, ContainerLocator locator, I accessInterface) {
private Text findContainerTitle(World world, ContainerLocator locator, I accessInterface) {
if (accessInterface instanceof ICustomNameObject) {
ICustomNameObject customNameObject = (ICustomNameObject) accessInterface;
@@ -112,7 +112,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
// FIXME: Should move this up, because at this point, it's hard to know where
// the terminal host came from (part or tile)
if (locator.hasBlockPos()) {
return new TranslationTextComponent(
return new TranslatableText(
world.getBlockState(locator.getBlockPos()).getBlock().getTranslationKey());
}
@@ -129,7 +129,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
return null; // No block was clicked
}
TileEntity tileEntity = player.world.getTileEntity(locator.getBlockPos());
BlockEntity tileEntity = player.world.getTileEntity(locator.getBlockPos());
// The tile entity itself can host a terminal (i.e. Chest!)
if (interfaceClass.isInstance(tileEntity)) {
@@ -24,7 +24,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.Slot;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.world.World;
import appeng.api.config.SecurityPermissions;
@@ -56,7 +56,7 @@ public class CraftAmountContainer extends AEBaseContainer {
this.addSlot(this.getCraftingItem());
}
public static CraftAmountContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftAmountContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -32,8 +32,8 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.text.Text;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.World;
@@ -74,7 +74,7 @@ public class CraftConfirmContainer extends AEBaseContainer {
private static final ContainerHelper<CraftConfirmContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftConfirmContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static CraftConfirmContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftConfirmContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -100,7 +100,7 @@ public class CraftConfirmContainer extends AEBaseContainer {
@GuiSync(6)
public boolean noCPU = true;
@GuiSync(7)
public ITextComponent myName;
public Text myName;
public CraftConfirmContainer(int id, PlayerInventory ip, ITerminalHost te) {
super(TYPE, id, ip, te);
@@ -390,11 +390,11 @@ public class CraftConfirmContainer extends AEBaseContainer {
this.selectedCpu = selectedCpu;
}
public ITextComponent getName() {
public Text getName() {
return this.myName;
}
private void setName(@Nullable final ITextComponent myName) {
private void setName(@Nullable final Text myName) {
this.myName = myName;
}
@@ -25,8 +25,8 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.text.Text;
import appeng.api.AEApi;
import appeng.api.config.SecurityPermissions;
@@ -64,7 +64,7 @@ public class CraftingCPUContainer extends AEBaseContainer
.createList();
private IGrid network;
private CraftingCPUCluster monitor = null;
private ITextComponent cpuName = null;
private Text cpuName = null;
@GuiSync(0)
public long eta = -1;
@@ -90,7 +90,7 @@ public class CraftingCPUContainer extends AEBaseContainer
}
}
public static CraftingCPUContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingCPUContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -220,7 +220,7 @@ public class CraftingCPUContainer extends AEBaseContainer
}
@Override
public ITextComponent getCustomInventoryName() {
public Text getCustomInventoryName() {
return this.cpuName;
}
@@ -20,12 +20,12 @@ package appeng.container.implementations;
import javax.annotation.Nonnull;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.text.Text;
import appeng.api.networking.crafting.ICraftingCPU;
public class CraftingCPURecord implements Comparable<CraftingCPURecord> {
private final ITextComponent myName;
private final Text myName;
private final ICraftingCPU cpu;
private final long size;
private final int processors;
@@ -50,7 +50,7 @@ public class CraftingCPURecord implements Comparable<CraftingCPURecord> {
return this.cpu;
}
ITextComponent getName() {
Text getName() {
return this.myName;
}
@@ -27,8 +27,8 @@ import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.text.Text;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.crafting.ICraftingCPU;
@@ -45,7 +45,7 @@ public class CraftingStatusContainer extends CraftingCPUContainer {
private static final ContainerHelper<CraftingStatusContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftingStatusContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static CraftingStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -59,7 +59,7 @@ public class CraftingStatusContainer extends CraftingCPUContainer {
@GuiSync(6)
public boolean noCPU = true;
@GuiSync(7)
public ITextComponent myName;
public Text myName;
public CraftingStatusContainer(int id, final PlayerInventory ip, final ITerminalHost te) {
super(TYPE, id, ip, te);
@@ -18,6 +18,7 @@
package appeng.container.implementations;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.CraftingInventory;
@@ -26,9 +27,8 @@ import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import appeng.api.config.SecurityPermissions;
@@ -52,7 +52,7 @@ public class CraftingTermContainer extends MEMonitorableContainer
private static final ContainerHelper<CraftingTermContainer, ITerminalHost> helper = new ContainerHelper<>(
CraftingTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static CraftingTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static CraftingTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -70,7 +70,7 @@ public class CraftingTermContainer extends MEMonitorableContainer
super(TYPE, id, ip, monitorable, false);
this.ct = (CraftingTerminalPart) monitorable;
final IItemHandler crafting = this.ct.getInventoryByName("crafting");
final ItemTransferable crafting = this.ct.getInventoryByName("crafting");
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
@@ -120,13 +120,13 @@ public class CraftingTermContainer extends MEMonitorableContainer
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
}
@Override
public IItemHandler getInventoryByName(final String name) {
public ItemTransferable getInventoryByName(final String name) {
if (name.equals("player")) {
return new PlayerInvWrapper(this.getPlayerInventory());
}
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
@@ -35,7 +35,7 @@ public class DriveContainer extends AEBaseContainer {
private static final ContainerHelper<DriveContainer, DriveTileEntity> helper = new ContainerHelper<>(
DriveContainer::new, DriveTileEntity.class);
public static DriveContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static DriveContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -18,11 +18,11 @@
package appeng.container.implementations;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.FuzzyMode;
import appeng.api.config.SecurityPermissions;
@@ -44,7 +44,7 @@ public class FormationPlaneContainer extends UpgradeableContainer {
private static final ContainerHelper<FormationPlaneContainer, FormationPlanePart> helper = new ContainerHelper<>(
FormationPlaneContainer::new, FormationPlanePart.class, SecurityPermissions.BUILD);
public static FormationPlaneContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static FormationPlaneContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -69,7 +69,7 @@ public class FormationPlaneContainer extends UpgradeableContainer {
final int xo = 8;
final int yo = 23 + 6;
final IItemHandler config = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable config = this.getUpgradeable().getInventoryByName("config");
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 9; x++) {
if (y < 2) {
@@ -80,7 +80,7 @@ public class FormationPlaneContainer extends UpgradeableContainer {
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
@@ -21,8 +21,8 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
@@ -38,7 +38,7 @@ public class GrinderContainer extends AEBaseContainer {
private static final ContainerHelper<GrinderContainer, GrinderTileEntity> helper = new ContainerHelper<>(
GrinderContainer::new, GrinderTileEntity.class);
public static GrinderContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static GrinderContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -49,7 +49,7 @@ public class GrinderContainer extends AEBaseContainer {
public GrinderContainer(int id, final PlayerInventory ip, final GrinderTileEntity grinder) {
super(TYPE, id, ip, grinder, null);
IItemHandler inv = grinder.getInternalInventory();
ItemTransferable inv = grinder.getInternalInventory();
this.addSlot(new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.ORE, inv, 0, 12, 17,
this.getPlayerInventory()));
@@ -18,11 +18,11 @@
package appeng.container.implementations;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.FullnessMode;
import appeng.api.config.OperationMode;
@@ -43,7 +43,7 @@ public class IOPortContainer extends UpgradeableContainer {
private static final ContainerHelper<IOPortContainer, IOPortTileEntity> helper = new ContainerHelper<>(
IOPortContainer::new, IOPortTileEntity.class, SecurityPermissions.BUILD);
public static IOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static IOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -70,7 +70,7 @@ public class IOPortContainer extends UpgradeableContainer {
int offX = 19;
int offY = 17;
final IItemHandler cells = this.getUpgradeable().getInventoryByName("cells");
final ItemTransferable cells = this.getUpgradeable().getInventoryByName("cells");
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 2; x++) {
@@ -88,7 +88,7 @@ public class IOPortContainer extends UpgradeableContainer {
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
@@ -23,8 +23,8 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.AEApi;
import appeng.api.definitions.IItemDefinition;
@@ -50,7 +50,7 @@ public class InscriberContainer extends UpgradeableContainer implements IProgres
private static final ContainerHelper<InscriberContainer, InscriberTileEntity> helper = new ContainerHelper<>(
InscriberContainer::new, InscriberTileEntity.class);
public static InscriberContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InscriberContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -74,7 +74,7 @@ public class InscriberContainer extends UpgradeableContainer implements IProgres
super(TYPE, id, ip, te);
this.ti = te;
IItemHandler inv = te.getInternalInventory();
ItemTransferable inv = te.getInternalInventory();
RestrictedInputSlot top = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.INSCRIBER_PLATE, inv, 0,
45, 16, this.getPlayerInventory());
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings;
@@ -42,7 +42,7 @@ public class InterfaceContainer extends UpgradeableContainer {
private static final ContainerHelper<InterfaceContainer, IInterfaceHost> helper = new ContainerHelper<>(
InterfaceContainer::new, IInterfaceHost.class, SecurityPermissions.BUILD);
public static InterfaceContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InterfaceContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -29,9 +29,9 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.text.Text;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings;
@@ -67,7 +67,7 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
private static final ContainerHelper<InterfaceTerminalContainer, InterfaceTerminalPart> helper = new ContainerHelper<>(
InterfaceTerminalContainer::new, InterfaceTerminalPart.class, SecurityPermissions.BUILD);
public static InterfaceTerminalContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static InterfaceTerminalContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -196,7 +196,7 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
final InventoryAdaptor playerHand = new AdaptorItemHandler(new WrapperCursorItemHandler(player.inventory));
final IItemHandler theSlot = new WrapperFilteredItemHandler(
final ItemTransferable theSlot = new WrapperFilteredItemHandler(
new WrapperRangeItemHandler(inv.server, slot, slot + 1), new PatternSlotFilter());
final InventoryAdaptor interfaceSlot = new AdaptorItemHandler(theSlot);
@@ -333,7 +333,7 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
if (tag.isEmpty()) {
tag.putLong("sortBy", inv.sortBy);
tag.putString("un", ITextComponent.Serializer.toJson(inv.name));
tag.putString("un", Text.Serializer.toJson(inv.name));
}
for (int x = 0; x < length; x++) {
@@ -358,11 +358,11 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
private final long sortBy;
private final long which = autoBase++;
private final ITextComponent name;
private final IItemHandler client;
private final IItemHandler server;
private final Text name;
private final ItemTransferable client;
private final ItemTransferable server;
public InvTracker(final DualityInterface dual, final IItemHandler patterns, final ITextComponent name) {
public InvTracker(final DualityInterface dual, final ItemTransferable patterns, final Text name) {
this.server = patterns;
this.client = new AppEngInternalInventory(null, this.server.getSlots());
this.name = name;
@@ -372,12 +372,12 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
private static class PatternSlotFilter implements IAEItemFilter {
@Override
public boolean allowExtract(IItemHandler inv, int slot, int amount) {
public boolean allowExtract(ItemTransferable inv, int slot, int amount) {
return true;
}
@Override
public boolean allowInsert(IItemHandler inv, int slot, ItemStack stack) {
public boolean allowInsert(ItemTransferable inv, int slot, ItemStack stack) {
return !stack.isEmpty() && stack.getItem() instanceof EncodedPatternItem;
}
}
@@ -18,14 +18,14 @@
package appeng.container.implementations;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.FuzzyMode;
import appeng.api.config.LevelType;
@@ -47,7 +47,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
private static final ContainerHelper<LevelEmitterContainer, LevelEmitterPart> helper = new ContainerHelper<>(
LevelEmitterContainer::new, LevelEmitterPart.class, SecurityPermissions.BUILD);
public static LevelEmitterContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static LevelEmitterContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -57,7 +57,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
private final LevelEmitterPart lvlEmitter;
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
private TextFieldWidget textField;
@GuiSync(2)
public LevelType lvType;
@@ -71,7 +71,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
this.lvlEmitter = te;
}
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public void setTextField(final TextFieldWidget level) {
this.textField = level;
this.textField.setText(String.valueOf(this.EmitterValue));
@@ -84,7 +84,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
@Override
protected void setupConfig() {
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
if (this.availableUpgrades() > 0) {
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
@@ -102,7 +102,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
8 + 18 * 3, this.getPlayerInventory())).setNotDraggable());
}
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable inv = this.getUpgradeable().getInventoryByName("config");
final int y = 40;
final int x = 80 + 44;
this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y));
@@ -29,8 +29,8 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntity;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
@@ -83,7 +83,7 @@ public class MEMonitorableContainer extends AEBaseContainer
private static final ContainerHelper<MEMonitorableContainer, ITerminalHost> helper = new ContainerHelper<>(
MEMonitorableContainer::new, ITerminalHost.class);
public static MEMonitorableContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MEMonitorableContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -111,7 +111,7 @@ public class MEMonitorableContainer extends AEBaseContainer
public MEMonitorableContainer(ContainerType<?> containerType, int id, PlayerInventory ip,
final ITerminalHost monitorable, final boolean bindInventory) {
super(containerType, id, ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null,
super(containerType, id, ip, monitorable instanceof BlockEntity ? (BlockEntity) monitorable : null,
monitorable instanceof IPart ? (IPart) monitorable : null,
monitorable instanceof IGuiItemObject ? (IGuiItemObject) monitorable : null);
@@ -22,7 +22,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
@@ -37,7 +37,7 @@ public class MEPortableCellContainer extends MEMonitorableContainer {
private static final ContainerHelper<MEPortableCellContainer, IPortableCell> helper = new ContainerHelper<>(
MEPortableCellContainer::new, IPortableCell.class);
public static MEPortableCellContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MEPortableCellContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -18,14 +18,14 @@
package appeng.container.implementations;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.RedstoneMode;
import appeng.api.config.SecurityPermissions;
@@ -49,7 +49,7 @@ public class MolecularAssemblerContainer extends UpgradeableContainer implements
private static final ContainerHelper<MolecularAssemblerContainer, MolecularAssemblerTileEntity> helper = new ContainerHelper<>(
MolecularAssemblerContainer::new, MolecularAssemblerTileEntity.class);
public static MolecularAssemblerContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static MolecularAssemblerContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -70,7 +70,7 @@ public class MolecularAssemblerContainer extends UpgradeableContainer implements
}
public boolean isValidItemForSlot(final int slotIndex, final ItemStack i) {
final IItemHandler mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
final ItemTransferable mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
final ItemStack is = mac.getStackInSlot(10);
if (is.isEmpty()) {
@@ -99,7 +99,7 @@ public class MolecularAssemblerContainer extends UpgradeableContainer implements
int offX = 29;
int offY = 30;
final IItemHandler mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
final ItemTransferable mac = this.getUpgradeable().getInventoryByName(MolecularAssemblerTileEntity.INVENTORY_MAIN);
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
@@ -120,7 +120,7 @@ public class MolecularAssemblerContainer extends UpgradeableContainer implements
offX = 122;
offY = 17;
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
@@ -25,7 +25,7 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.AEApi;
import appeng.api.implementations.guiobjects.INetworkTool;
@@ -53,7 +53,7 @@ public class NetworkStatusContainer extends AEBaseContainer {
private static final ContainerHelper<NetworkStatusContainer, INetworkTool> helper = new ContainerHelper<>(
NetworkStatusContainer::new, INetworkTool.class);
public static NetworkStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static NetworkStatusContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -23,7 +23,7 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.implementations.guiobjects.INetworkTool;
import appeng.container.AEBaseContainer;
@@ -38,7 +38,7 @@ public class NetworkToolContainer extends AEBaseContainer {
private static final ContainerHelper<NetworkToolContainer, INetworkTool> helper = new ContainerHelper<>(
NetworkToolContainer::new, INetworkTool.class);
public static NetworkToolContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static NetworkToolContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
@@ -37,9 +38,8 @@ import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import appeng.api.AEApi;
@@ -82,7 +82,7 @@ public class PatternTermContainer extends MEMonitorableContainer
private static final ContainerHelper<PatternTermContainer, ITerminalHost> helper = new ContainerHelper<>(
PatternTermContainer::new, ITerminalHost.class, SecurityPermissions.CRAFT);
public static PatternTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static PatternTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -92,7 +92,7 @@ public class PatternTermContainer extends MEMonitorableContainer
private final PatternTerminalPart patternTerminal;
private final AppEngInternalInventory cOut = new AppEngInternalInventory(null, 1);
private final IItemHandler crafting;
private final ItemTransferable crafting;
private final FakeCraftingMatrixSlot[] craftingSlots = new FakeCraftingMatrixSlot[9];
private final OptionalFakeSlot[] outputSlots = new OptionalFakeSlot[3];
private final PatternTermSlot craftSlot;
@@ -109,8 +109,8 @@ public class PatternTermContainer extends MEMonitorableContainer
super(TYPE, id, ip, monitorable, false);
this.patternTerminal = (PatternTerminalPart) monitorable;
final IItemHandler patternInv = this.getPatternTerminal().getInventoryByName("pattern");
final IItemHandler output = this.getPatternTerminal().getInventoryByName("output");
final ItemTransferable patternInv = this.getPatternTerminal().getInventoryByName("pattern");
final ItemTransferable output = this.getPatternTerminal().getInventoryByName("output");
this.crafting = this.getPatternTerminal().getInventoryByName("crafting");
@@ -194,8 +194,8 @@ public class PatternTermContainer extends MEMonitorableContainer
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
}
@@ -487,7 +487,7 @@ public class PatternTermContainer extends MEMonitorableContainer
}
@Override
public IItemHandler getInventoryByName(final String name) {
public ItemTransferable getInventoryByName(final String name) {
if (name.equals("player")) {
return new PlayerInvWrapper(this.getPlayerInventory());
}
@@ -18,14 +18,14 @@
package appeng.container.implementations;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraft.network.PacketByteBuf;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import appeng.api.config.SecurityPermissions;
import appeng.api.parts.IPart;
@@ -42,7 +42,7 @@ public class PriorityContainer extends AEBaseContainer {
private static final ContainerHelper<PriorityContainer, IPriorityHost> helper = new ContainerHelper<>(
PriorityContainer::new, IPriorityHost.class, SecurityPermissions.BUILD);
public static PriorityContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static PriorityContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -52,18 +52,18 @@ public class PriorityContainer extends AEBaseContainer {
private final IPriorityHost priHost;
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
private TextFieldWidget textField;
@GuiSync(2)
public long PriorityValue = -1;
public PriorityContainer(int id, final PlayerInventory ip, final IPriorityHost te) {
super(TYPE, id, ip, (TileEntity) (te instanceof TileEntity ? te : null),
super(TYPE, id, ip, (BlockEntity) (te instanceof BlockEntity ? te : null),
(IPart) (te instanceof IPart ? te : null));
this.priHost = te;
}
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public void setTextField(final TextFieldWidget level) {
this.textField = level;
this.textField.setText(String.valueOf(this.PriorityValue));
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
@@ -36,7 +36,7 @@ public class QNBContainer extends AEBaseContainer {
private static final ContainerHelper<QNBContainer, QuantumBridgeTileEntity> helper = new ContainerHelper<>(
QNBContainer::new, QuantumBridgeTileEntity.class, SecurityPermissions.BUILD);
public static QNBContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static QNBContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -20,15 +20,15 @@ package appeng.container.implementations;
import javax.annotation.Nonnull;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.container.AEBaseContainer;
@@ -47,7 +47,7 @@ public class QuartzKnifeContainer extends AEBaseContainer {
private static final ContainerHelper<QuartzKnifeContainer, QuartzKnifeObj> helper = new ContainerHelper<>(
QuartzKnifeContainer::new, QuartzKnifeObj.class);
public static QuartzKnifeContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static QuartzKnifeContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -57,7 +57,7 @@ public class QuartzKnifeContainer extends AEBaseContainer {
private final QuartzKnifeObj toolInv;
private final IItemHandler inSlot = new AppEngInternalInventory(null, 1, 1);
private final ItemTransferable inSlot = new AppEngInternalInventory(null, 1, 1);
private String myName = "";
public QuartzKnifeContainer(int id, final PlayerInventory ip, final QuartzKnifeObj te) {
@@ -105,13 +105,13 @@ public class QuartzKnifeContainer extends AEBaseContainer {
}
private class QuartzKniveSlot extends OutputSlot {
QuartzKniveSlot(IItemHandler a, int b, int c, int d, int i) {
QuartzKniveSlot(ItemTransferable a, int b, int c, int d, int i) {
super(a, b, c, d, i);
}
@Override
public ItemStack getStack() {
final IItemHandler baseInv = this.getItemHandler();
final ItemTransferable baseInv = this.getItemHandler();
final ItemStack input = baseInv.getStackInSlot(0);
if (input == ItemStack.EMPTY) {
return ItemStack.EMPTY;
@@ -23,8 +23,8 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.AEApi;
import appeng.api.config.SecurityPermissions;
@@ -74,7 +74,7 @@ public class SecurityStationContainer extends MEMonitorableContainer implements
this.bindPlayerInventory(ip, 0, 0);
}
public static SecurityStationContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SecurityStationContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -139,8 +139,8 @@ public class SecurityStationContainer extends MEMonitorableContainer implements
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
if (!this.wirelessOut.getHasStack()) {
if (this.wirelessIn.getHasStack()) {
final ItemStack term = this.wirelessIn.getStack().copy();
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
@@ -52,7 +52,7 @@ public class SkyChestContainer extends AEBaseContainer {
this.bindPlayerInventory(ip, 0, 195 - /* height of player inventory */82);
}
public static SkyChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SkyChestContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.IGrid;
@@ -77,7 +77,7 @@ public class SpatialIOPortContainer extends AEBaseContainer {
this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */82);
}
public static SpatialIOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static SpatialIOPortContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -20,12 +20,12 @@ package appeng.container.implementations;
import java.util.Iterator;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.network.PacketByteBuf;
import appeng.api.AEApi;
import appeng.api.config.AccessRestriction;
@@ -55,7 +55,7 @@ public class StorageBusContainer extends UpgradeableContainer {
private static final ContainerHelper<StorageBusContainer, StorageBusPart> helper = new ContainerHelper<>(
StorageBusContainer::new, StorageBusPart.class, SecurityPermissions.BUILD);
public static StorageBusContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static StorageBusContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -86,7 +86,7 @@ public class StorageBusContainer extends UpgradeableContainer {
final int xo = 8;
final int yo = 23 + 6;
final IItemHandler config = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable config = this.getUpgradeable().getInventoryByName("config");
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 9; x++) {
if (y < 2) {
@@ -97,7 +97,7 @@ public class StorageBusContainer extends UpgradeableContainer {
}
}
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18,
@@ -148,7 +148,7 @@ public class StorageBusContainer extends UpgradeableContainer {
}
public void partition() {
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable inv = this.getUpgradeable().getInventoryByName("config");
final IMEInventory<IAEItemStack> cellInv = this.storageBus.getInternalHandler();
@@ -18,16 +18,16 @@
package appeng.container.implementations;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
@@ -60,7 +60,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
private static final ContainerHelper<UpgradeableContainer, IUpgradeableHost> helper = new ContainerHelper<>(
UpgradeableContainer::new, IUpgradeableHost.class, SecurityPermissions.BUILD);
public static UpgradeableContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static UpgradeableContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -86,7 +86,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
public UpgradeableContainer(ContainerType<?> containerType, int id, final PlayerInventory ip,
final IUpgradeableHost te) {
super(containerType, id, ip, (TileEntity) (te instanceof TileEntity ? te : null),
super(containerType, id, ip, (BlockEntity) (te instanceof BlockEntity ? te : null),
(IPart) (te instanceof IPart ? te : null));
this.upgradeable = te;
@@ -95,8 +95,8 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
int yCoord = 0;
int zCoord = 0;
if (te instanceof TileEntity) {
final TileEntity myTile = (TileEntity) te;
if (te instanceof BlockEntity) {
final BlockEntity myTile = (BlockEntity) te;
w = myTile.getWorld();
xCoord = myTile.getPos().getX();
yCoord = myTile.getPos().getY();
@@ -104,7 +104,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
}
if (te instanceof IPart) {
final TileEntity mk = te.getTile();
final BlockEntity mk = te.getTile();
w = mk.getWorld();
xCoord = mk.getPos().getX();
yCoord = mk.getPos().getY();
@@ -149,7 +149,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
protected void setupConfig() {
this.setupUpgrades();
final IItemHandler inv = this.getUpgradeable().getInventoryByName("config");
final ItemTransferable inv = this.getUpgradeable().getInventoryByName("config");
final int y = 40;
final int x = 80;
this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y));
@@ -168,7 +168,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
}
protected void setupUpgrades() {
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final ItemTransferable upgrades = this.getUpgradeable().getInventoryByName("upgrades");
if (this.availableUpgrades() > 0) {
this.addSlot((new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.UPGRADES, upgrades, 0, 187, 8,
this.getPlayerInventory())).setNotDraggable());
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator;
@@ -38,7 +38,7 @@ public class VibrationChamberContainer extends AEBaseContainer implements IProgr
private static final ContainerHelper<VibrationChamberContainer, VibrationChamberTileEntity> helper = new ContainerHelper<>(
VibrationChamberContainer::new, VibrationChamberTileEntity.class);
public static VibrationChamberContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static VibrationChamberContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.api.config.SecurityPermissions;
import appeng.container.AEBaseContainer;
@@ -38,7 +38,7 @@ public class WirelessContainer extends AEBaseContainer {
private static final ContainerHelper<WirelessContainer, WirelessTileEntity> helper = new ContainerHelper<>(
WirelessContainer::new, WirelessTileEntity.class, SecurityPermissions.BUILD);
public static WirelessContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static WirelessContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketByteBuf;
import appeng.container.ContainerLocator;
import appeng.core.AEConfig;
@@ -36,7 +36,7 @@ public class WirelessTermContainer extends MEPortableCellContainer {
private static final ContainerHelper<WirelessTermContainer, WirelessTerminalGuiObject> helper = new ContainerHelper<>(
WirelessTermContainer::new, WirelessTerminalGuiObject.class);
public static WirelessTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
public static WirelessTermContainer fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf buf) {
return helper.fromNetwork(windowId, inv, buf);
}
@@ -18,6 +18,7 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
@@ -25,7 +26,6 @@ import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.fml.hooks.BasicEventHooks;
import net.minecraftforge.items.IItemHandler;
import appeng.util.helpers.ItemHandlerUtil;
import appeng.util.inv.WrapperInvItemHandler;
@@ -35,7 +35,7 @@ public class AppEngCraftingSlot extends AppEngSlot {
/**
* The craft matrix inventory linked to this result slot.
*/
private final IItemHandler craftMatrix;
private final ItemTransferable craftMatrix;
/**
* The player that is using the GUI where this slot resides.
@@ -48,8 +48,8 @@ public class AppEngCraftingSlot extends AppEngSlot {
*/
private int amountCrafted;
public AppEngCraftingSlot(final PlayerEntity par1PlayerEntity, final IItemHandler par2IInventory,
final IItemHandler par3IInventory, final int par4, final int par5, final int par6) {
public AppEngCraftingSlot(final PlayerEntity par1PlayerEntity, final ItemTransferable par2IInventory,
final ItemTransferable par3IInventory, final int par4, final int par5, final int par6) {
super(par3IInventory, par4, par5, par6);
this.thePlayer = par1PlayerEntity;
this.craftMatrix = par2IInventory;
@@ -20,21 +20,21 @@ package appeng.container.slot;
import javax.annotation.Nonnull;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
import appeng.container.AEBaseContainer;
import appeng.util.helpers.ItemHandlerUtil;
public class AppEngSlot extends Slot {
private static IInventory emptyInventory = new Inventory(0);
private final IItemHandler itemHandler;
private final ItemTransferable itemHandler;
private final int index;
private final int defX;
@@ -46,7 +46,7 @@ public class AppEngSlot extends Slot {
private CalculatedValidity isValid;
private boolean isDisplay = false;
public AppEngSlot(final IItemHandler inv, final int idx, final int x, final int y) {
public AppEngSlot(final ItemTransferable inv, final int idx, final int x, final int y) {
super(emptyInventory, idx, x, y);
this.itemHandler = inv;
this.index = idx;
@@ -115,7 +115,7 @@ public class AppEngSlot extends Slot {
}
}
public IItemHandler getItemHandler() {
public ItemTransferable getItemHandler() {
return this.itemHandler;
}
@@ -156,7 +156,7 @@ public class AppEngSlot extends Slot {
}
@Override
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public boolean isEnabled() {
return this.isSlotEnabled();
}
@@ -18,9 +18,9 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.container.AEBaseContainer;
import appeng.util.inv.WrapperInvItemHandler;
@@ -29,8 +29,8 @@ public class CraftingMatrixSlot extends AppEngSlot {
private final AEBaseContainer c;
private final IInventory wrappedInventory;
public CraftingMatrixSlot(final AEBaseContainer c, final IItemHandler par1iInventory, final int par2,
final int par3, final int par4) {
public CraftingMatrixSlot(final AEBaseContainer c, final ItemTransferable par1iInventory, final int par2,
final int par3, final int par4) {
super(par1iInventory, par2, par3, par4);
this.c = c;
this.wrappedInventory = new WrapperInvItemHandler(par1iInventory);
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
@@ -31,7 +32,6 @@ import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
@@ -57,8 +57,8 @@ import appeng.util.item.AEItemStack;
public class CraftingTermSlot extends AppEngCraftingSlot {
private final IItemHandler craftInv;
private final IItemHandler pattern;
private final ItemTransferable craftInv;
private final ItemTransferable pattern;
private final IActionSource mySrc;
private final IEnergySource energySrc;
@@ -66,8 +66,8 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
private final IContainerCraftingPacket container;
public CraftingTermSlot(final PlayerEntity player, final IActionSource mySrc, final IEnergySource energySrc,
final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix,
final IItemHandler output, final int x, final int y, final IContainerCraftingPacket ccp) {
final IStorageMonitorable storage, final ItemTransferable cMatrix, final ItemTransferable secondMatrix,
final ItemTransferable output, final int x, final int y, final IContainerCraftingPacket ccp) {
super(player, cMatrix, output, 0, x, y);
this.energySrc = energySrc;
this.storage = storage;
@@ -77,7 +77,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
this.container = ccp;
}
public IItemHandler getCraftingMatrix() {
public ItemTransferable getCraftingMatrix() {
return this.craftInv;
}
@@ -286,7 +286,7 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
}
}
IItemHandler getPattern() {
ItemTransferable getPattern() {
return this.pattern;
}
}
@@ -20,11 +20,11 @@ package appeng.container.slot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class DisabledSlot extends AppEngSlot {
public DisabledSlot(final IItemHandler par1iInventory, final int slotIndex, final int x, final int y) {
public DisabledSlot(final ItemTransferable par1iInventory, final int slotIndex, final int x, final int y) {
super(par1iInventory, slotIndex, x, y);
}
@@ -18,11 +18,11 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class FakeBlacklistSlot extends FakeTypeOnlySlot {
public FakeBlacklistSlot(final IItemHandler inv, final int idx, final int x, final int y) {
public FakeBlacklistSlot(final ItemTransferable inv, final int idx, final int x, final int y) {
super(inv, idx, x, y);
}
@@ -18,11 +18,11 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class FakeCraftingMatrixSlot extends FakeSlot {
public FakeCraftingMatrixSlot(final IItemHandler inv, final int idx, final int x, final int y) {
public FakeCraftingMatrixSlot(final ItemTransferable inv, final int idx, final int x, final int y) {
super(inv, idx, x, y);
}
}
@@ -18,13 +18,13 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
public class FakeSlot extends AppEngSlot {
public FakeSlot(final IItemHandler inv, final int idx, final int x, final int y) {
public FakeSlot(final ItemTransferable inv, final int idx, final int x, final int y) {
super(inv, idx, x, y);
}
@@ -18,12 +18,12 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
public class FakeTypeOnlySlot extends FakeSlot {
public FakeTypeOnlySlot(final IItemHandler inv, final int idx, final int x, final int y) {
public FakeTypeOnlySlot(final ItemTransferable inv, final int idx, final int x, final int y) {
super(inv, idx, x, y);
}
@@ -20,13 +20,13 @@ package appeng.container.slot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class InaccessibleSlot extends AppEngSlot {
private ItemStack dspStack = ItemStack.EMPTY;
public InaccessibleSlot(final IItemHandler i, final int slotIdx, final int x, final int y) {
public InaccessibleSlot(final ItemTransferable i, final int slotIdx, final int x, final int y) {
super(i, slotIdx, x, y);
}
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.container.implementations.MolecularAssemblerContainer;
@@ -27,8 +27,8 @@ public class MolecularAssemblerPatternSlot extends AppEngSlot {
private final MolecularAssemblerContainer mac;
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final IItemHandler i, final int slotIdx,
final int x, final int y) {
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final ItemTransferable i, final int slotIdx,
final int x, final int y) {
super(i, slotIdx, x, y);
this.mac = mac;
}
@@ -18,11 +18,11 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class NormalSlot extends AppEngSlot {
public NormalSlot(final IItemHandler inv, final int slot, final int xPos, final int yPos) {
public NormalSlot(final ItemTransferable inv, final int slot, final int xPos, final int yPos) {
super(inv, slot, xPos, yPos);
}
}
@@ -21,7 +21,7 @@ package appeng.container.slot;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class OptionalFakeSlot extends FakeSlot implements IOptionalSlot {
@@ -31,8 +31,8 @@ public class OptionalFakeSlot extends FakeSlot implements IOptionalSlot {
private final IOptionalSlotHost host;
private boolean renderDisabled = true;
public OptionalFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x,
final int y, final int offX, final int offY, final int groupNum) {
public OptionalFakeSlot(final ItemTransferable inv, final IOptionalSlotHost containerBus, final int idx, final int x,
final int y, final int offX, final int offY, final int groupNum) {
super(inv, idx, x + offX * 18, y + offY * 18);
this.srcX = x;
this.srcY = y;
@@ -18,15 +18,15 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class OptionalNormalSlot extends AppEngSlot implements IOptionalSlot {
private final int groupNum;
private final IOptionalSlotHost host;
public OptionalNormalSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int slot,
final int xPos, final int yPos, final int groupNum) {
public OptionalNormalSlot(final ItemTransferable inv, final IOptionalSlotHost containerBus, final int slot,
final int xPos, final int yPos, final int groupNum) {
super(inv, slot, xPos, yPos);
this.groupNum = groupNum;
this.host = containerBus;
@@ -18,16 +18,16 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraftforge.items.IItemHandler;
public class OptionalRestrictedInputSlot extends RestrictedInputSlot {
private final int groupNum;
private final IOptionalSlotHost host;
public OptionalRestrictedInputSlot(final PlacableItemType valid, final IItemHandler i, final IOptionalSlotHost host,
final int slotIndex, final int x, final int y, final int grpNum, final PlayerInventory invPlayer) {
public OptionalRestrictedInputSlot(final PlacableItemType valid, final ItemTransferable i, final IOptionalSlotHost host,
final int slotIndex, final int x, final int y, final int grpNum, final PlayerInventory invPlayer) {
super(valid, i, slotIndex, x, y, invPlayer);
this.groupNum = grpNum;
this.host = host;
@@ -19,12 +19,12 @@
package appeng.container.slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class OptionalTypeOnlyFakeSlot extends OptionalFakeSlot {
public OptionalTypeOnlyFakeSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx,
final int x, final int y, final int offX, final int offY, final int groupNum) {
public OptionalTypeOnlyFakeSlot(final ItemTransferable inv, final IOptionalSlotHost containerBus, final int idx,
final int x, final int y, final int offX, final int offY, final int groupNum) {
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
}
@@ -19,11 +19,11 @@
package appeng.container.slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class OutputSlot extends AppEngSlot {
public OutputSlot(final IItemHandler a, final int b, final int c, final int d, final int i) {
public OutputSlot(final ItemTransferable a, final int b, final int c, final int d, final int i) {
super(a, b, c, d);
this.setIIcon(i);
}
@@ -18,12 +18,12 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class PatternOutputsSlot extends OptionalFakeSlot {
public PatternOutputsSlot(final IItemHandler inv, final IOptionalSlotHost containerBus, final int idx, final int x,
final int y, final int offX, final int offY, final int groupNum) {
public PatternOutputsSlot(final ItemTransferable inv, final IOptionalSlotHost containerBus, final int idx, final int x,
final int y, final int offX, final int offY, final int groupNum) {
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
}
@@ -18,9 +18,9 @@
package appeng.container.slot;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.networking.energy.IEnergySource;
@@ -37,9 +37,9 @@ public class PatternTermSlot extends CraftingTermSlot {
private final IOptionalSlotHost host;
public PatternTermSlot(final PlayerEntity player, final IActionSource mySrc, final IEnergySource energySrc,
final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix,
final IItemHandler output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber,
final IContainerCraftingPacket c) {
final IStorageMonitorable storage, final ItemTransferable cMatrix, final ItemTransferable secondMatrix,
final ItemTransferable output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber,
final IContainerCraftingPacket c) {
super(player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c);
this.host = h;
@@ -18,11 +18,11 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
public class PlayerHotBarSlot extends AppEngSlot {
public PlayerHotBarSlot(final IItemHandler par1iInventory, final int par2, final int par3, final int par4) {
public PlayerHotBarSlot(final ItemTransferable par1iInventory, final int par2, final int par3, final int par4) {
super(par1iInventory, par2, par3, par4);
this.setPlayerSide(true);
}
@@ -18,13 +18,13 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
public class PlayerInvSlot extends AppEngSlot {
public PlayerInvSlot(final IItemHandler par1iInventory, final int idx, final int x, final int y) {
public PlayerInvSlot(final ItemTransferable par1iInventory, final int idx, final int x, final int y) {
super(par1iInventory, idx, x, y);
this.setPlayerSide(true);
@@ -21,6 +21,7 @@ package appeng.container.slot;
import java.util.List;
import java.util.Set;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.PlayerEntity;
@@ -28,10 +29,9 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.definitions.IDefinitions;
@@ -58,20 +58,20 @@ import appeng.util.Platform;
*/
public class RestrictedInputSlot extends AppEngSlot {
private static final List<ResourceLocation> METAL_INGOT_TAGS = ImmutableList.of(
new ResourceLocation("forge:ingots/copper"), new ResourceLocation("forge:ingots/tin"),
new ResourceLocation("forge:ingots/iron"), new ResourceLocation("forge:ingots/gold"),
new ResourceLocation("forge:ingots/lead"), new ResourceLocation("forge:ingots/bronze"),
new ResourceLocation("forge:ingots/brass"), new ResourceLocation("forge:ingots/nickel"),
new ResourceLocation("forge:ingots/aluminium"));
private static final List<Identifier> METAL_INGOT_TAGS = ImmutableList.of(
new Identifier("forge:ingots/copper"), new Identifier("forge:ingots/tin"),
new Identifier("forge:ingots/iron"), new Identifier("forge:ingots/gold"),
new Identifier("forge:ingots/lead"), new Identifier("forge:ingots/bronze"),
new Identifier("forge:ingots/brass"), new Identifier("forge:ingots/nickel"),
new Identifier("forge:ingots/aluminium"));
private final PlacableItemType which;
private final PlayerInventory p;
private boolean allowEdit = true;
private int stackLimit = -1;
public RestrictedInputSlot(final PlacableItemType valid, final IItemHandler i, final int slotIndex, final int x,
final int y, final PlayerInventory p) {
public RestrictedInputSlot(final PlacableItemType valid, final ItemTransferable i, final int slotIndex, final int x,
final int y, final PlayerInventory p) {
super(i, slotIndex, x, y);
this.which = valid;
this.setIIcon(valid.IIcon);
@@ -247,8 +247,8 @@ public class RestrictedInputSlot extends AppEngSlot {
return true;
}
Set<ResourceLocation> itemTags = i.getItem().getTags();
for (ResourceLocation tagName : METAL_INGOT_TAGS) {
Set<Identifier> itemTags = i.getItem().getTags();
for (Identifier tagName : METAL_INGOT_TAGS) {
if (itemTags.contains(tagName)) {
return true;
}