diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2023-12-03 00:50:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 00:50:34 +0800 |
commit | 4ff3ef790f4e22cc80986258f13f8a8643fda0dc (patch) | |
tree | 7bf841bb6877ef9b083a6626dfe21c481d07b6cc | |
parent | eefc47cf99e68eb3c3a13e69c9d2bf5f6f901706 (diff) | |
download | GT5-Unofficial-4ff3ef790f4e22cc80986258f13f8a8643fda0dc.tar.gz GT5-Unofficial-4ff3ef790f4e22cc80986258f13f8a8643fda0dc.tar.bz2 GT5-Unofficial-4ff3ef790f4e22cc80986258f13f8a8643fda0dc.zip |
fix steam machine nei structure diagram (#789)
* fix steam machine nei structure diagram
this is caused by repeated failure of checkMachine(), which is caused by it not clearing special steam hatches
* more special hatch clearing
3 files changed, 38 insertions, 12 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index cf460ca084..aa7422a79b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -582,6 +582,18 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true); } + @Override + public void clearHatches() { + super.clearHatches(); + this.mChargeHatches.clear(); + this.mDischargeHatches.clear(); + this.mAirIntakes.clear(); + this.mTecTechEnergyHatches.clear(); + this.mTecTechDynamoHatches.clear(); + this.mAllEnergyHatches.clear(); + this.mAllDynamoHatches.clear(); + } + public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { return addToMachineListInternal(aList, getMetaTileEntity(aTileEntity), aBaseCasingIndex); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index 13b879dd00..7b88f718b5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -24,6 +24,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_HatchElementBuilder; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -307,6 +308,25 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu return false; } + @Override + public void clearHatches() { + super.clearHatches(); + mSteamInputFluids.clear(); + mSteamInputs.clear(); + mSteamOutputs.clear(); + } + + @Override + public boolean resetRecipeMapForAllInputHatches(GT_Recipe.GT_Recipe_Map aMap) { + boolean ret = super.resetRecipeMapForAllInputHatches(aMap); + for (GT_MetaTileEntity_Hatch_Steam_BusInput hatch : mSteamInputs) { + if (resetRecipeMapForHatch(hatch, aMap)) { + ret = true; + } + } + return ret; + } + protected static <T extends GregtechMeta_SteamMultiBase<T>> GT_HatchElementBuilder<T> buildSteamInput( Class<T> typeToken) { return buildHatchAdder(typeToken).adder(GregtechMeta_SteamMultiBase::addToMachineList).hatchIds(31040) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index 389e267545..dc793a9282 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -204,19 +204,13 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends } @Override + public void clearHatches() { + super.clearHatches(); + mTurbineRotorHatches.clear(); + } + + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - this.mDynamoHatches.clear(); - this.mTecTechDynamoHatches.clear(); - this.mTurbineRotorHatches.clear(); - this.mMaintenanceHatches.clear(); - if (requiresMufflers()) { - this.mMufflerHatches.clear(); - } - this.mInputBusses.clear(); - this.mInputHatches.clear(); - if (requiresOutputHatch()) { - this.mOutputHatches.clear(); - } // we do not check for casing count here. the bare minimal is 372 but we only require 360 boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0); log("Structure Check: " + aStructure); |