diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-18 20:48:51 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-18 20:48:51 +0000 |
commit | 1d307fe3d35a88882f8a3d5a054629f6530d8217 (patch) | |
tree | 6a076ad200345866f7add50b4dacb1c7c5084f91 /src | |
parent | 82f2d61465c1fcacfb5104115238c23da0783d0b (diff) | |
download | GT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.tar.gz GT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.tar.bz2 GT5-Unofficial-1d307fe3d35a88882f8a3d5a054629f6530d8217.zip |
Change handling of Formaldehyde Catalyst.
Fixed ChemPlant not working correctly.
Diffstat (limited to 'src')
7 files changed, 52 insertions, 16 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java index a42d179f65..43bd669829 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -103,6 +103,7 @@ public class GenericChem extends ItemPackage { public static ItemStack mPurpleCatalyst; public static ItemStack mBrownCatalyst; public static ItemStack mPinkCatalyst; + public static ItemStack mFormaldehydeCatalyst; public static ItemStack mMillingBallAlumina; public static ItemStack mMillingBallSoapstone; @@ -151,6 +152,7 @@ public class GenericChem extends ItemPackage { mSodiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 10, 1); mPotassiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 11, 1); mPotassiumHydroxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 12, 1); + mFormaldehydeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 13, 1); } @@ -169,6 +171,7 @@ public class GenericChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mSodiumEthylXanthate, "dustSodiumEthylXanthate"); ItemUtils.addItemToOreDictionary(mPotassiumEthylXanthate, "dustPotassiumEthylXanthate"); ItemUtils.addItemToOreDictionary(mPotassiumHydroxide, "dustPotassiumHydroxide"); + ItemUtils.addItemToOreDictionary(mFormaldehydeCatalyst, "catalystFormaldehyde"); } @@ -289,6 +292,7 @@ public class GenericChem extends ItemPackage { recipeCatalystPurple(); recipeCatalystBrown(); recipeCatalystPink(); + recipeCatalystFormaldehyde(); recipeGrindingBallAlumina(); recipeGrindingBallSoapstone(); @@ -773,6 +777,20 @@ public class GenericChem extends ItemPackage { 2000); } + + private void recipeCatalystFormaldehyde() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierThreeChip(), + CI.getEmptyCatalyst(4), + ItemUtils.getSimpleStack(RocketFuels.Formaldehyde_Catalyst_Dust, 8) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mFormaldehydeCatalyst, 4), + 30 * 20, + 240); + + } private void recipeCadaverineAndPutrescine() { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java index b96e0c76ea..c9c5ca98f6 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -54,7 +54,7 @@ public class RocketFuels extends ItemPackage { public static Fluid Monomethylhydrazine_Plus_Nitric_Acid; public static Item Ammonium_Nitrate_Dust; - public static Item Formaldehyde_Catalyst; + public static Item Formaldehyde_Catalyst_Dust; public static ItemStack Formaldehyde_Catalyst_Stack; public RocketFuels() { @@ -246,7 +246,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(21), - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), + ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0), }, new FluidStack[] { FluidUtils.getFluidStack("oxygen", 16000), @@ -273,7 +273,7 @@ public class RocketFuels extends ItemPackage { null, null, null, - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 4), + ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust, 4), 160, 30); @@ -284,7 +284,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(21), - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), + ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0), }, new FluidStack[] { FluidUtils.getFluidStack("fluid.hydrazine", 2000), @@ -492,8 +492,8 @@ public class RocketFuels extends ItemPackage { @Override public void items() { - Formaldehyde_Catalyst = ItemUtils.generateSpecialUseDusts("FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0]; - Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst); + Formaldehyde_Catalyst_Dust = ItemUtils.generateSpecialUseDusts("FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0]; + Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust); } @Override diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java index 9a00b49342..c763a1a434 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java @@ -23,7 +23,7 @@ public class ItemGenericChemBase extends Item { final protected IIcon base[]; - final private int aMetaSize = 13; + final private int aMetaSize = 14; /* * 0 - Red Metal Catalyst //FeCu @@ -39,6 +39,7 @@ public class ItemGenericChemBase extends Item { * 10 - Sodium Ethyl Xanthate //CH3CH2ONa + CS2 → CH3CH2OCS2Na * 11 - Potassium Ethyl Xanthate //CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O * 12 - Potassium Hydroxide // KOH + * 13 - Formaldehyde Catalyst //Fe16V1 */ public ItemGenericChemBase() { diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java index e96bd3391b..fa685aa93c 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -1314,9 +1314,6 @@ public class ItemUtils { } public static boolean isCatalyst(ItemStack aStack) { - if (GT_Utility.areStacksEqual(aStack, RocketFuels.Formaldehyde_Catalyst_Stack, true)) { - return true; - } if (GT_Utility.areStacksEqual(aStack, GenericChem.mBlueCatalyst, true)) { return true; } @@ -1338,6 +1335,9 @@ public class ItemUtils { if (GT_Utility.areStacksEqual(aStack, GenericChem.mPinkCatalyst, true)) { return true; } + if (GT_Utility.areStacksEqual(aStack, GenericChem.mFormaldehydeCatalyst, true)) { + return true; + } if (GT_Utility.areStacksEqual(aStack, AgriculturalChem.mGreenCatalyst, true)) { return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 42912c4fa8..4a01809ac7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -55,7 +55,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { +public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant> { private int mSolidCasingTier = 0; private int mMachineCasingTier = 0; @@ -568,10 +568,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } @Override - public boolean checkRecipe(final ItemStack aStack) { + public boolean checkRecipe(final ItemStack aStack) { return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus()); } + @Override + public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + ArrayList<ItemStack> tItems = getStoredInputs(); + ArrayList<FluidStack> tFluids = getStoredFluids(); + ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); + FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); + return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + } @Override public boolean checkRecipeGeneric( @@ -586,7 +594,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new FluidStack[]{}; - + long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); @@ -1035,12 +1043,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { @Override public ArrayList<ItemStack> getStoredInputs() { ArrayList<ItemStack> tItems = super.getStoredInputs(); + if (this.hasSlotInGUI() && this.getGUIItemStack() != null) { + tItems.add(this.getGUIItemStack()); + } for (GT_MetaTileEntity_Hatch_Catalysts tHatch : mCatalystBuses) { tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - tItems.addAll(tHatch.getContentUsageSlots()); + if (isValidMetaTileEntity(tHatch)) { + AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); + if (!aHatchContent.isEmpty()) { + tItems.addAll(aHatchContent); + } } - } + } return tItems; } } diff --git a/src/main/resources/assets/miscutils/lang/en_US.lang b/src/main/resources/assets/miscutils/lang/en_US.lang index 7a021cbc26..476062476f 100644 --- a/src/main/resources/assets/miscutils/lang/en_US.lang +++ b/src/main/resources/assets/miscutils/lang/en_US.lang @@ -3365,3 +3365,6 @@ item.itemGearPraseodymium.name=Praseodymium Gear item.itemCellPraseodymium.name=Praseodymium Cell item.milledMonazite.name=Milled Monazite item.FrothMonaziteflotation.name=Monazite Flotation Froth Cell + +//Added 18/12/21 +item.BasicGenericChemItem.13.name=Formaldehyde Catalyst diff --git a/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png b/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png Binary files differnew file mode 100644 index 0000000000..475f8dadfb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png |