diff --git a/container/slot/IOptionalSlotHost.java b/container/slot/IOptionalSlotHost.java new file mode 100644 index 00000000..40f78b9f --- /dev/null +++ b/container/slot/IOptionalSlotHost.java @@ -0,0 +1,8 @@ +package appeng.container.slot; + +public interface IOptionalSlotHost +{ + + boolean isSlotEnabled(int idx, OptionalSlotFake osf); + +} diff --git a/container/slot/OptionalSlotFake.java b/container/slot/OptionalSlotFake.java new file mode 100644 index 00000000..0331440e --- /dev/null +++ b/container/slot/OptionalSlotFake.java @@ -0,0 +1,29 @@ +package appeng.container.slot; + +import net.minecraft.inventory.IInventory; + +public class OptionalSlotFake extends SlotFake +{ + + int invSlot; + final int groupNum; + IOptionalSlotHost host; + + int srcX; + int srcY; + + public OptionalSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum) { + super( inv, idx, x + offX * 18, y + offY * 18 ); + srcX = x; + srcY = y; + invSlot = idx; + this.groupNum = groupNum; + } + + @Override + public boolean isEnabled() + { + return host.isSlotEnabled( groupNum, this ); + } + +}