Added spotless back and reformatted
This commit is contained in:
@@ -24,19 +24,19 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
import appeng.mixins.ScreenHandlerListeners;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -72,6 +72,7 @@ import appeng.core.sync.packets.TargetItemStackPacket;
|
||||
import appeng.helpers.ICustomNameObject;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.me.helpers.PlayerSource;
|
||||
import appeng.mixins.ScreenHandlerListeners;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.AdaptorFixedInv;
|
||||
@@ -97,13 +98,13 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
||||
// Slots that were created to represent the player inventory
|
||||
private List<Slot> playerInventorySlots = null;
|
||||
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart) {
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip,
|
||||
final BlockEntity myTile, final IPart myPart) {
|
||||
this(containerType, id, ip, myTile, myPart, null);
|
||||
}
|
||||
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip, final BlockEntity myTile,
|
||||
final IPart myPart, final IGuiItemObject gio) {
|
||||
public AEBaseContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip,
|
||||
final BlockEntity myTile, final IPart myPart, final IGuiItemObject gio) {
|
||||
super(containerType, id);
|
||||
this.invPlayer = ip;
|
||||
this.tileEntity = myTile;
|
||||
@@ -299,7 +300,7 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
||||
}
|
||||
|
||||
public List<ScreenHandlerListener> getListeners() {
|
||||
return ((ScreenHandlerListeners)this).ae2_getListeners();
|
||||
return ((ScreenHandlerListeners) this).ae2_getListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -672,8 +673,7 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
||||
ais = Platform.poweredInsert(this.getPowerSource(), this.getCellInventory(), ais,
|
||||
this.getActionSource());
|
||||
if (ais == null) {
|
||||
final InventoryAdaptor ia = new AdaptorFixedInv(
|
||||
new WrapperCursorItemHandler(player.inventory));
|
||||
final InventoryAdaptor ia = new AdaptorFixedInv(new WrapperCursorItemHandler(player.inventory));
|
||||
|
||||
final ItemStack fail = ia.removeItems(1, extracted.getDefinition(), null);
|
||||
if (fail.isEmpty()) {
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
|
||||
package appeng.container;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.parts.AEBasePart;
|
||||
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;
|
||||
@@ -35,6 +33,11 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.parts.AEBasePart;
|
||||
|
||||
/**
|
||||
* Describes how a container the player has opened was originally located. This
|
||||
* can be one of three ways:
|
||||
@@ -198,8 +201,8 @@ public final class ContainerLocator {
|
||||
case 0:
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY, buf.readInt(), (Identifier) null, null, null);
|
||||
case 1:
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, buf.readInt(), buf.readIdentifier(),
|
||||
buf.readBlockPos(), AEPartLocation.values()[buf.readByte()]);
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, buf.readInt(),
|
||||
buf.readIdentifier(), buf.readBlockPos(), AEPartLocation.values()[buf.readByte()]);
|
||||
case 2:
|
||||
return new ContainerLocator(Type.BLOCK, -1, buf.readIdentifier(), buf.readBlockPos(), null);
|
||||
case 3:
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -20,15 +20,16 @@ package appeng.container.implementations;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.impl.EmptyFixedItemInv;
|
||||
|
||||
import appeng.api.config.CopyMode;
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -20,8 +20,9 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package appeng.container.implementations;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -28,8 +30,6 @@ import appeng.helpers.ICustomNameObject;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Helper for containers that can be opened for a part <em>or</em> tile given
|
||||
* that either implements a given interface.
|
||||
@@ -142,8 +142,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 TranslatableText(
|
||||
world.getBlockState(locator.getBlockPos()).getBlock().getTranslationKey());
|
||||
return new TranslatableText(world.getBlockState(locator.getBlockPos()).getBlock().getTranslationKey());
|
||||
}
|
||||
|
||||
return new LiteralText("Unknown");
|
||||
|
||||
@@ -22,9 +22,9 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
|
||||
@@ -29,12 +29,12 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
|
||||
@@ -26,8 +26,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
|
||||
@@ -18,19 +18,20 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.ContainerLocator;
|
||||
@@ -121,7 +122,7 @@ public class CraftingTermContainer extends MEMonitorableContainer
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final FixedItemInv inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerLocator;
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
|
||||
@@ -20,8 +20,9 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.FullnessMode;
|
||||
import appeng.api.config.OperationMode;
|
||||
|
||||
@@ -20,10 +20,11 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
@@ -33,8 +34,8 @@ import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.container.slot.OutputSlot;
|
||||
import appeng.container.slot.RestrictedInputSlot;
|
||||
import appeng.core.Api;
|
||||
import appeng.tile.misc.InscriberRecipes;
|
||||
import appeng.tile.misc.InscriberBlockEntity;
|
||||
import appeng.tile.misc.InscriberRecipes;
|
||||
import appeng.util.Platform;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
|
||||
@@ -25,12 +25,13 @@ import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -195,8 +196,8 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
|
||||
|
||||
final InventoryAdaptor playerHand = new AdaptorFixedInv(new WrapperCursorItemHandler(player.inventory));
|
||||
|
||||
final FixedItemInv theSlot = new WrapperFilteredItemHandler(
|
||||
inv.server.getSubInv(slot, slot + 1), new PatternSlotFilter());
|
||||
final FixedItemInv theSlot = new WrapperFilteredItemHandler(inv.server.getSubInv(slot, slot + 1),
|
||||
new PatternSlotFilter());
|
||||
final InventoryAdaptor interfaceSlot = new AdaptorFixedInv(theSlot);
|
||||
|
||||
switch (action) {
|
||||
@@ -259,8 +260,7 @@ public final class InterfaceTerminalContainer extends AEBaseContainer {
|
||||
|
||||
final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor(player);
|
||||
for (int x = 0; x < inv.server.getSlotCount(); x++) {
|
||||
ItemHandlerUtil.setStackInSlot(inv.server, x,
|
||||
playerInvAd.addItems(inv.server.getInvStack(x)));
|
||||
ItemHandlerUtil.setStackInSlot(inv.server, x, playerInvAd.addItems(inv.server.getInvStack(x)));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -18,14 +18,15 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
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.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.LevelType;
|
||||
|
||||
@@ -23,14 +23,14 @@ import java.nio.BufferOverflowException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -110,7 +110,7 @@ public class MEMonitorableContainer extends AEBaseContainer
|
||||
}
|
||||
|
||||
public MEMonitorableContainer(ScreenHandlerType<?> containerType, int id, PlayerInventory ip,
|
||||
final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
super(containerType, id, ip, monitorable instanceof BlockEntity ? (BlockEntity) monitorable : null,
|
||||
monitorable instanceof IPart ? (IPart) monitorable : null,
|
||||
monitorable instanceof IGuiItemObject ? (IGuiItemObject) monitorable : null);
|
||||
|
||||
@@ -20,9 +20,9 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -56,7 +56,7 @@ public class MEPortableCellContainer extends MEMonitorableContainer {
|
||||
}
|
||||
|
||||
protected MEPortableCellContainer(ScreenHandlerType<? extends MEPortableCellContainer> type, int id,
|
||||
final PlayerInventory ip, final IPortableCell monitorable) {
|
||||
final PlayerInventory ip, final IPortableCell monitorable) {
|
||||
super(type, id, ip, monitorable, false);
|
||||
if (monitorable instanceof IInventorySlotAware) {
|
||||
final int slotIndex = ((IInventorySlotAware) monitorable).getInventorySlot();
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
|
||||
import appeng.api.implementations.guiobjects.INetworkTool;
|
||||
import appeng.api.networking.IGrid;
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.implementations.guiobjects.INetworkTool;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -80,8 +80,7 @@ public class NetworkToolContainer extends AEBaseContainer {
|
||||
if (currentItem != this.toolInv.getItemStack()) {
|
||||
if (!currentItem.isEmpty()) {
|
||||
if (ItemStack.areItemsEqual(this.toolInv.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv().setStack(this.getPlayerInv().selectedSlot,
|
||||
this.toolInv.getItemStack());
|
||||
this.getPlayerInv().setStack(this.getPlayerInv().selectedSlot, this.toolInv.getItemStack());
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
|
||||
@@ -21,28 +21,28 @@ package appeng.container.implementations;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
import appeng.mixins.SlotMixin;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.CraftingResultInventory;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.recipe.CraftingRecipe;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.screen.slot.CraftingResultSlot;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.inventory.CraftingResultInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.recipe.CraftingRecipe;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.screen.slot.CraftingResultSlot;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.crafting.ICraftingHelper;
|
||||
@@ -66,6 +66,7 @@ import appeng.core.sync.packets.PatternSlotPacket;
|
||||
import appeng.helpers.IContainerCraftingPacket;
|
||||
import appeng.items.storage.ViewCellItem;
|
||||
import appeng.me.helpers.MachineSource;
|
||||
import appeng.mixins.SlotMixin;
|
||||
import appeng.parts.reporting.PatternTerminalPart;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
@@ -165,7 +166,6 @@ public class PatternTermContainer extends MEMonitorableContainer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setStackInSlot(int slotID, ItemStack stack) {
|
||||
super.setStackInSlot(slotID, stack);
|
||||
@@ -203,7 +203,7 @@ public class PatternTermContainer extends MEMonitorableContainer
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final FixedItemInv inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ public class PatternTermContainer extends MEMonitorableContainer
|
||||
: packetPatternSlot.pattern[x].createItemStack());
|
||||
}
|
||||
|
||||
final Recipe<CraftingInventory> r = p.world.getRecipeManager().getFirstMatch(RecipeType.CRAFTING, ic, p.world)
|
||||
.orElse(null);
|
||||
final Recipe<CraftingInventory> r = p.world.getRecipeManager()
|
||||
.getFirstMatch(RecipeType.CRAFTING, ic, p.world).orElse(null);
|
||||
|
||||
if (r == null) {
|
||||
return;
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package appeng.container.implementations;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
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.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.parts.IPart;
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -20,13 +20,14 @@ package appeng.container.implementations;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerLocator;
|
||||
@@ -82,8 +83,7 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
if (currentItem != this.toolInv.getItemStack()) {
|
||||
if (!currentItem.isEmpty()) {
|
||||
if (ItemStack.areItemsEqual(this.toolInv.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv().setStack(this.getPlayerInv().selectedSlot,
|
||||
this.toolInv.getItemStack());
|
||||
this.getPlayerInv().setStack(this.getPlayerInv().selectedSlot, this.toolInv.getItemStack());
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
@@ -147,11 +147,11 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
final ItemStack item = QuartzKnifeContainer.this.toolInv.getItemStack();
|
||||
final ItemStack before = item.copy();
|
||||
item.damage(1, QuartzKnifeContainer.this.getPlayerInv().player, p -> {
|
||||
QuartzKnifeContainer.this.getPlayerInv().setStack(
|
||||
QuartzKnifeContainer.this.getPlayerInv().selectedSlot, ItemStack.EMPTY);
|
||||
QuartzKnifeContainer.this.getPlayerInv()
|
||||
.setStack(QuartzKnifeContainer.this.getPlayerInv().selectedSlot, ItemStack.EMPTY);
|
||||
// FIXME FABRIC equivalent??
|
||||
// FIXME FABRIC MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(
|
||||
// FIXME FABRIC QuartzKnifeContainer.this.getPlayerInv().player, before, null));
|
||||
// FIXME FABRIC QuartzKnifeContainer.this.getPlayerInv().player, before, null));
|
||||
});
|
||||
|
||||
QuartzKnifeContainer.this.sendContentUpdates();
|
||||
|
||||
@@ -20,10 +20,11 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerListener;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -140,7 +141,7 @@ public class SecurityStationContainer extends MEMonitorableContainer implements
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final FixedItemInv inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
if (!this.wirelessOut.hasStack()) {
|
||||
if (this.wirelessIn.hasStack()) {
|
||||
final ItemStack term = this.wirelessIn.getStack().copy();
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerLocator;
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.networking.IGrid;
|
||||
|
||||
@@ -20,12 +20,13 @@ package appeng.container.implementations;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
|
||||
@@ -22,11 +22,12 @@ import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -85,7 +86,7 @@ public class UpgradeableContainer extends AEBaseContainer implements IOptionalSl
|
||||
}
|
||||
|
||||
public UpgradeableContainer(ScreenHandlerType<?> containerType, int id, final PlayerInventory ip,
|
||||
final IUpgradeableHost te) {
|
||||
final IUpgradeableHost te) {
|
||||
super(containerType, id, ip, (BlockEntity) (te instanceof BlockEntity ? te : null),
|
||||
(IPart) (te instanceof IPart ? te : null));
|
||||
this.upgradeable = te;
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerLocator;
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -20,15 +20,15 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
public class WirelessTermContainer extends MEPortableCellContainer {
|
||||
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.util.helpers.ItemHandlerUtil;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AppEngCraftingSlot extends AppEngSlot {
|
||||
|
||||
@@ -47,7 +48,7 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
private int amountCrafted;
|
||||
|
||||
public AppEngCraftingSlot(final PlayerEntity par1PlayerEntity, final FixedItemInv par2IInventory,
|
||||
final FixedItemInv par3IInventory, final int par4, final int par5, final int par6) {
|
||||
final FixedItemInv par3IInventory, final int par4, final int par5, final int par6) {
|
||||
super(par3IInventory, par4, par5, par6);
|
||||
this.thePlayer = par1PlayerEntity;
|
||||
this.craftMatrix = par2IInventory;
|
||||
@@ -85,9 +86,11 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
|
||||
@Override
|
||||
public ItemStack onTakeItem(final PlayerEntity playerIn, final ItemStack stack) {
|
||||
// FIXME FABRIC BasicEventHooks.firePlayerCraftingEvent(playerIn, stack, new WrapperInvItemHandler(this.craftMatrix));
|
||||
// FIXME FABRIC BasicEventHooks.firePlayerCraftingEvent(playerIn, stack, new
|
||||
// WrapperInvItemHandler(this.craftMatrix));
|
||||
this.onCrafted(stack);
|
||||
// FIXME FABRIC: net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
|
||||
// FIXME FABRIC:
|
||||
// net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
|
||||
final CraftingInventory ic = new CraftingInventory(this.getContainer(), 3, 3);
|
||||
|
||||
for (int x = 0; x < this.craftMatrix.getSlotCount(); x++) {
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.SingleItemSlot;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -29,7 +28,10 @@ import net.minecraft.inventory.SimpleInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import alexiil.mc.lib.attributes.item.SingleItemSlot;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
public class AppEngSlot extends Slot {
|
||||
private static Inventory emptyInventory = new SimpleInventory(0);
|
||||
@@ -152,8 +154,6 @@ public class AppEngSlot extends Slot {
|
||||
return !backingSlot.get().isEmpty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public boolean doDrawHoveringEffect() {
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.util.inv.WrapperInvItemHandler;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class CraftingMatrixSlot extends AppEngSlot {
|
||||
private final Inventory wrappedInventory;
|
||||
|
||||
public CraftingMatrixSlot(final AEBaseContainer c, final FixedItemInv par1iInventory, final int par2,
|
||||
final int par3, final int par4) {
|
||||
final int par3, final int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
this.c = c;
|
||||
this.wrappedInventory = new WrapperInvItemHandler(par1iInventory);
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -33,6 +32,8 @@ import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
@@ -66,8 +67,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 FixedItemInv cMatrix, final FixedItemInv secondMatrix,
|
||||
final FixedItemInv output, final int x, final int y, final IContainerCraftingPacket ccp) {
|
||||
final IStorageMonitorable storage, final FixedItemInv cMatrix, final FixedItemInv secondMatrix,
|
||||
final FixedItemInv output, final int x, final int y, final IContainerCraftingPacket ccp) {
|
||||
super(player, cMatrix, output, 0, x, y);
|
||||
this.energySrc = energySrc;
|
||||
this.storage = storage;
|
||||
@@ -138,8 +139,8 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
if (!extra.isEmpty()) {
|
||||
final List<ItemStack> drops = new ArrayList<>();
|
||||
drops.add(extra);
|
||||
Platform.spawnDrops(who.world,
|
||||
new BlockPos((int) who.getX(), (int) who.getY(), (int) who.getZ()), drops);
|
||||
Platform.spawnDrops(who.world, new BlockPos((int) who.getX(), (int) who.getY(), (int) who.getZ()),
|
||||
drops);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -201,8 +202,9 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
|
||||
if (r == null) {
|
||||
final Item target = request.getItem();
|
||||
// FIXME FABRIC: This entire code-path may be pointless because RepairItemRecipe is of type CRAFTING
|
||||
if (target.isDamageable() /* FIXME FABRIC && target.isRepairable(request) */) {
|
||||
// FIXME FABRIC: This entire code-path may be pointless because RepairItemRecipe
|
||||
// is of type CRAFTING
|
||||
if (target.isDamageable() /* FIXME FABRIC && target.isRepairable(request) */) {
|
||||
boolean isBad = false;
|
||||
for (int x = 0; x < ic.size(); x++) {
|
||||
final ItemStack pis = ic.getStack(x);
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.container.slot;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class DisabledSlot extends AppEngSlot {
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class FakeSlot extends AppEngSlot {
|
||||
|
||||
public FakeSlot(final FixedItemInv inv, final int idx, final int x, final int y) {
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class FakeTypeOnlySlot extends FakeSlot {
|
||||
|
||||
public FakeTypeOnlySlot(final FixedItemInv inv, final int idx, final int x, final int y) {
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.container.slot;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class InaccessibleSlot extends AppEngSlot {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.container.implementations.MolecularAssemblerContainer;
|
||||
@@ -30,7 +31,7 @@ public class MolecularAssemblerPatternSlot extends AppEngSlot {
|
||||
private final int slotIdx;
|
||||
|
||||
public MolecularAssemblerPatternSlot(final MolecularAssemblerContainer mac, final FixedItemInv i, final int slotIdx,
|
||||
final int x, final int y) {
|
||||
final int x, final int y) {
|
||||
super(i, slotIdx, x, y);
|
||||
this.mac = mac;
|
||||
this.slotIdx = slotIdx;
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.container.slot;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class OptionalFakeSlot extends FakeSlot implements IOptionalSlot {
|
||||
@@ -32,7 +33,7 @@ public class OptionalFakeSlot extends FakeSlot implements IOptionalSlot {
|
||||
private boolean renderDisabled = true;
|
||||
|
||||
public OptionalFakeSlot(final FixedItemInv inv, final IOptionalSlotHost containerBus, final int idx, final int x,
|
||||
final int y, final int offX, final int offY, final int groupNum) {
|
||||
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;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class OptionalNormalSlot extends AppEngSlot implements IOptionalSlot {
|
||||
private final IOptionalSlotHost host;
|
||||
|
||||
public OptionalNormalSlot(final FixedItemInv inv, final IOptionalSlotHost containerBus, final int slot,
|
||||
final int xPos, final int yPos, final int groupNum) {
|
||||
final int xPos, final int yPos, final int groupNum) {
|
||||
super(inv, slot, xPos, yPos);
|
||||
this.groupNum = groupNum;
|
||||
this.host = containerBus;
|
||||
|
||||
@@ -18,16 +18,17 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class OptionalRestrictedInputSlot extends RestrictedInputSlot {
|
||||
|
||||
private final int groupNum;
|
||||
private final IOptionalSlotHost host;
|
||||
|
||||
public OptionalRestrictedInputSlot(final PlacableItemType valid, final FixedItemInv i, final IOptionalSlotHost host,
|
||||
final int slotIndex, final int x, final int y, final int grpNum, final PlayerInventory invPlayer) {
|
||||
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,13 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class OptionalTypeOnlyFakeSlot extends OptionalFakeSlot {
|
||||
|
||||
public OptionalTypeOnlyFakeSlot(final FixedItemInv inv, final IOptionalSlotHost containerBus, final int idx,
|
||||
final int x, final int y, final int offX, final int offY, final int groupNum) {
|
||||
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,6 +19,7 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
public class OutputSlot extends AppEngSlot {
|
||||
|
||||
@@ -23,7 +23,7 @@ import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
public class PatternOutputsSlot extends OptionalFakeSlot {
|
||||
|
||||
public PatternOutputsSlot(final FixedItemInv inv, final IOptionalSlotHost containerBus, final int idx, final int x,
|
||||
final int y, final int offX, final int offY, final int groupNum) {
|
||||
final int y, final int offX, final int offY, final int groupNum) {
|
||||
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
|
||||
package appeng.container.slot;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
@@ -37,9 +38,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 FixedItemInv cMatrix, final FixedItemInv secondMatrix,
|
||||
final FixedItemInv output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber,
|
||||
final IContainerCraftingPacket c) {
|
||||
final IStorageMonitorable storage, final FixedItemInv cMatrix, final FixedItemInv secondMatrix,
|
||||
final FixedItemInv 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;
|
||||
|
||||
@@ -20,21 +20,22 @@ package appeng.container.slot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.tag.ItemTags;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.crafting.ICraftingHelper;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IItems;
|
||||
@@ -60,12 +61,10 @@ import appeng.util.Platform;
|
||||
*/
|
||||
public class RestrictedInputSlot extends AppEngSlot {
|
||||
|
||||
private static final List<Identifier> METAL_INGOT_TAGS = ImmutableList.of(
|
||||
new Identifier("c:copper_ingots"), new Identifier("c:tin_ingots"),
|
||||
new Identifier("c:iron_ingots"), new Identifier("c:gold_ingots"),
|
||||
new Identifier("c:lead_ingots"), new Identifier("c:bronze_ingots"),
|
||||
new Identifier("c:brass_ingots"), new Identifier("c:nickel_ingots"),
|
||||
new Identifier("c:aluminium_ingots"));
|
||||
private static final List<Identifier> METAL_INGOT_TAGS = ImmutableList.of(new Identifier("c:copper_ingots"),
|
||||
new Identifier("c:tin_ingots"), new Identifier("c:iron_ingots"), new Identifier("c:gold_ingots"),
|
||||
new Identifier("c:lead_ingots"), new Identifier("c:bronze_ingots"), new Identifier("c:brass_ingots"),
|
||||
new Identifier("c:nickel_ingots"), new Identifier("c:aluminium_ingots"));
|
||||
|
||||
private final PlacableItemType which;
|
||||
private final PlayerInventory p;
|
||||
@@ -73,7 +72,7 @@ public class RestrictedInputSlot extends AppEngSlot {
|
||||
private int stackLimit = -1;
|
||||
|
||||
public RestrictedInputSlot(final PlacableItemType valid, final FixedItemInv i, final int slotIndex, final int x,
|
||||
final int y, final PlayerInventory p) {
|
||||
final int y, final PlayerInventory p) {
|
||||
super(i, slotIndex, x, y);
|
||||
this.which = valid;
|
||||
this.setIIcon(valid.IIcon);
|
||||
|
||||
Reference in New Issue
Block a user