From 15a114d5fd7b18a14ac8561aaf46db903022763a Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:37:26 +0000 Subject: Fixed GregtechMeta_MultiBlockBase not handling hatches correctly. --- .../base/GregtechMeta_MultiBlockBase.java | 172 +++++++++------------ .../GregtechMetaTileEntity_SpargeTower.java | 18 ++- 2 files changed, 88 insertions(+), 102 deletions(-) diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 51a9dd717c..d413ce44e4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -1665,14 +1665,7 @@ public abstract class GregtechMeta_MultiBlockBase boolean addToMachineListInternal(ArrayList aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - return addToMachineListInternal(aList, aMetaTileEntity, aBaseCasingIndex); + return addToMachineListInternal(aList, getMetaTileEntity(aTileEntity), aBaseCasingIndex); } public boolean addToMachineListInternal(ArrayList aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { @@ -1770,33 +1763,35 @@ public abstract class GregtechMeta_MultiBlockBase()); } GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); - return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + Logger.INFO("Added Hatch: "+addedHatch); + return addedHatch; } @Override @@ -295,6 +298,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB // check base if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) { + Logger.INFO("Bad Base. Height: "+mHeight); return false; } @@ -302,6 +306,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB while (mHeight < 8 && checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0) && !mTopLayerFound) { if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) { // layer without output hatch + Logger.INFO("Height: "+mHeight + " - Missing output on "+(mHeight - 1)); return false; } // not top @@ -313,7 +318,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB Logger.INFO("Casings: "+mCasing); Logger.INFO("Required: "+(7 * mHeight - 5)); Logger.INFO("Found Top: "+mTopLayerFound); - return mCasing >= 7 * mHeight - 5 && mTopLayerFound && mMaintenanceHatches.size() == 1; + return mCasing >= 45 && mTopLayerFound && mMaintenanceHatches.size() == 1; } @Override @@ -369,6 +374,11 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB return null; } + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + @Override public String getMachineType() { return "Gas Sparger"; -- cgit