From fd1becc546c966bf7894849c843f1dcc0919618b Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:56:00 -0600 Subject: Fix ME Output Hatch void protection checks (#3585) --- .../common/tileentities/machines/MTEHatchOutputME.java | 10 ++++++++++ .../tileentities/machines/multi/MTEDistillationTower.java | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java index 7ddf136a72..b502ad54d3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java @@ -160,6 +160,16 @@ public class MTEHatchOutputME extends MTEHatchOutput implements IPowerChannelSta return getCachedAmount() < getCacheCapacity(); } + /** + * Get the available fluid space, up to max int. + */ + @Override + public int getAvailableSpace() { + long availableSpace = getCacheCapacity() - getCachedAmount(); + if (availableSpace > Integer.MAX_VALUE) availableSpace = Integer.MAX_VALUE; + return (int) availableSpace; + } + /** * Attempt to store fluid in connected ME network. Returns how much fluid is accepted (if the network was down e.g.) * diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java index 93b64c16a8..bbba029449 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java @@ -47,7 +47,6 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.MultiblockTooltipBuilder; -import gregtech.common.tileentities.machines.MTEHatchOutputME; public class MTEDistillationTower extends MTEEnhancedMultiBlockBase implements ISurvivalConstructable { @@ -293,15 +292,6 @@ public class MTEDistillationTower extends MTEEnhancedMultiBlockBase tLayerOutputHatches.stream() - .anyMatch(tHatch -> (tHatch instanceof MTEHatchOutputME tMEHatch) && (tMEHatch.canAcceptFluid()))); - } - @Override public void construct(ItemStack stackSize, boolean hintsOnly) { buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0); -- cgit