From a88fed98878a081350cde7a0ee6d3fdd1a3de420 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 11 Dec 2021 18:07:47 +0000 Subject: Fixed issue of Multiblock hatches/buses not being assigned recipe maps. Removed 7 from Charge Pack tooltips. Initial work on Elemental Duplicator. --- .../base/GregtechMeta_MultiBlockBase.java | 130 ++++++++++++++++----- .../base/GregtechMeta_SteamMultiBase.java | 18 +-- 2 files changed, 108 insertions(+), 40 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base') 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 9aff009ec5..fd021f1487 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 @@ -7,7 +7,6 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.IToolStats; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; @@ -67,6 +66,10 @@ import java.util.function.Function; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +// Glee8e - 11/12/21 - 2:15pm +// Yeah, now I see what's wrong. Someone inherited from GregtechMeta_MultiBlockBase instead of GregtechMeta_MultiBlockBase as it should have been +// so any method in GregtechMetaTileEntity_IndustrialDehydrator would see generic field declared in GregtechMeta_MultiBlockBase without generic parameter + public abstract class GregtechMeta_MultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true; @@ -95,14 +98,15 @@ public abstract class GregtechMeta_MultiBlockBase mControlCoreBus = new ArrayList(); public ArrayList mAirIntakes = new ArrayList(); public ArrayList mChargeHatches = new ArrayList(); public ArrayList mDischargeHatches = new ArrayList(); + public ArrayList mAllEnergyHatches = new ArrayList(); + public ArrayList mAllDynamoHatches = new ArrayList(); // Custom Behaviour Map - private static final HashMap mCustomBehviours = new HashMap();; + private static final HashMap mCustomBehviours = new HashMap(); public GregtechMeta_MultiBlockBase(final int aID, final String aName, @@ -1468,6 +1472,8 @@ public abstract class GregtechMeta_MultiBlockBase boolean addToMachineListInternal(ArrayList aList, final IMetaTileEntity aTileEntity, - final int aBaseCasingIndex) { + public 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); + } + + public boolean addToMachineListInternal(ArrayList aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { if (aTileEntity == null) { return false; } @@ -1669,7 +1685,15 @@ public abstract class GregtechMeta_MultiBlockBase aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if * (!aHatchType.isInstance(aTileEntity)) { return false; } */ + + // Try setRecipeMap + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch_Input) aTileEntity).mRecipeMap = getRecipeMap(); + } + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + ((GT_MetaTileEntity_Hatch_InputBus) aTileEntity).mRecipeMap = getRecipeMap(); + } if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { @@ -1780,7 +1804,7 @@ public abstract class GregtechMeta_MultiBlockBase mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); if (mDynamoClass != null){ @@ -2105,11 +2132,27 @@ public abstract class GregtechMeta_MultiBlockBase mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); if (mDynamoClass != null){ @@ -2151,11 +2204,26 @@ public abstract class GregtechMeta_MultiBlockBase