diff options
Diffstat (limited to 'src/main/java/gregtech/common')
3 files changed, 29 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java index 83a5789430..e7af09ef90 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java @@ -715,7 +715,7 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ needPatternSync = true; } - private ItemStack[] getSharedItems() { + public ItemStack[] getSharedItems() { ItemStack[] sharedItems = new ItemStack[SLOT_MANUAL_SIZE + 1]; sharedItems[0] = mInventory[SLOT_CIRCUIT]; System.arraycopy(mInventory, SLOT_MANUAL_START, sharedItems, 1, SLOT_MANUAL_SIZE); @@ -952,4 +952,17 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ public void setCustomName(String name) { customName = name; } + + @Override + public Optional<IDualInputInventory> getFirstNonEmptyInventory() { + for (PatternSlot slot : internalInventory) { + if (slot != null && !slot.isEmpty()) return Optional.of(slot); + } + return Optional.empty(); + } + + @Override + public boolean supportsFluids() { + return this.supportFluids; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java index 2ea053995c..f2048f82ce 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java @@ -144,6 +144,16 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_Slave extends GT_MetaTileEnti } @Override + public Optional<IDualInputInventory> getFirstNonEmptyInventory() { + return getMaster() != null ? getMaster().getFirstNonEmptyInventory() : Optional.empty(); + } + + @Override + public boolean supportsFluids() { + return getMaster() != null && getMaster().supportsFluids(); + } + + @Override public boolean justUpdated() { return getMaster() != null && getMaster().justUpdated(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/IDualInputHatch.java b/src/main/java/gregtech/common/tileentities/machines/IDualInputHatch.java index 54b1acbdfa..c89aaaff40 100644 --- a/src/main/java/gregtech/common/tileentities/machines/IDualInputHatch.java +++ b/src/main/java/gregtech/common/tileentities/machines/IDualInputHatch.java @@ -1,6 +1,7 @@ package gregtech.common.tileentities.machines; import java.util.Iterator; +import java.util.Optional; import net.minecraft.item.ItemStack; @@ -13,4 +14,8 @@ public interface IDualInputHatch { void updateTexture(int id); void updateCraftingIcon(ItemStack icon); + + Optional<IDualInputInventory> getFirstNonEmptyInventory(); + + public boolean supportsFluids(); } |