diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java index d6a62e1..e2ee0f4 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java @@ -52,6 +52,7 @@ public class CompactingDrawerTile extends ControllableDrawerTile this.handler); this.hasCheckedRecipes = false; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerControllerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerControllerTile.java index 8f28fa8..ac4d83e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerControllerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerControllerTile.java @@ -3,6 +3,7 @@ package com.buuz135.functionalstorage.block.tile; import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.config.FunctionalStorageConfig; import com.buuz135.functionalstorage.inventory.ControllerInventoryHandler; +import com.buuz135.functionalstorage.inventory.ILockable; import com.buuz135.functionalstorage.item.ConfigurationToolItem; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.annotation.Save; @@ -76,14 +77,34 @@ public class DrawerControllerTile extends ControllableDrawerTile { +public abstract class BigInventoryHandler implements IItemHandler, INBTSerializable, ILockable { public static String BIG_ITEMS = "BigItems"; public static String STACK = "Stack"; @@ -20,7 +20,7 @@ public abstract class BigInventoryHandler implements IItemHandler, INBTSerializa private final FunctionalStorage.DrawerType type; private List storedStacks; - public BigInventoryHandler(FunctionalStorage.DrawerType type){ + public BigInventoryHandler(FunctionalStorage.DrawerType type) { this.type = type; this.storedStacks = new ArrayList<>(); for (int i = 0; i < type.getSlots(); i++) { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java index 5d6dfd5..6596eb7 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java @@ -11,7 +11,7 @@ import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -public abstract class CompactingInventoryHandler implements IItemHandler, INBTSerializable { +public abstract class CompactingInventoryHandler implements IItemHandler, INBTSerializable, ILockable { public static String PARENT = "Parent"; public static String BIG_ITEMS = "BigItems"; @@ -179,8 +179,6 @@ public abstract class CompactingInventoryHandler implements IItemHandler, INBTSe public abstract boolean isVoid(); - public abstract boolean isLocked(); - public List getResultList() { return resultList; } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java index 0e0e9e5..c49b166 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java @@ -22,7 +22,6 @@ public abstract class ControllerInventoryHandler implements IItemHandler { this.slots = getDrawers().getHandlers().stream().filter(iItemHandler -> !(iItemHandler instanceof ControllerInventoryHandler)).map(IItemHandler::getSlots).mapToInt(Integer::intValue).sum(); } - @NotNull @Override public ItemStack getStackInSlot(int slot) { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java index 998930c..bb31b37 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java @@ -4,7 +4,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.world.EnderSavedData; import net.minecraft.nbt.CompoundTag; -public class EnderInventoryHandler extends BigInventoryHandler{ +public class EnderInventoryHandler extends BigInventoryHandler implements ILockable { public static String NBT_LOCKED = "Locked"; public static String NBT_VOID = "Void"; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ILockable.java b/src/main/java/com/buuz135/functionalstorage/inventory/ILockable.java new file mode 100644 index 0000000..245d1cf --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ILockable.java @@ -0,0 +1,8 @@ +package com.buuz135.functionalstorage.inventory; + +public interface ILockable { + + boolean isLocked(); + + +}