From 9f5163d0a18c4ba4f4046effb87e90d285242ee6 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 10:55:59 -0600 Subject: cleanup and typo fix --- .../chemplant/GregtechMTE_ChemicalPlant.java | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 4a2747a3db..bb22297b28 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -105,7 +105,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { tt.addMachineType(getMachineType()) .addInfo("Controller Block for the Chemical Plant") .addInfo("Heavy Industry, now right at your doorstep!") - .addInfo("Please read to user manual for more information on construction & usage") + .addInfo("Please read the user manual for more information on construction and usage") .addSeparator() .addController("Bottom Center") .addStructureHint("Catalyst Housing", 1) @@ -591,7 +591,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { return false; } - // checks if it has a catalyst with enough durability + // checks if it has a catalyst ItemStack tCatalystRecipe = findCatalyst(aItemInputs); boolean aDoesRecipeNeedCatalyst = false; for (ItemStack aInputItem : tRecipe.mInputs) { @@ -606,7 +606,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { return false; } if (mCatalystBuses.size() != 1) { - log("does not have correct number of catalyst hatchs. (Required 1, found "+mCatalystBuses.size()+")"); + log("does not have correct number of catalyst hatches. (Required 1, found "+mCatalystBuses.size()+")"); return false; } } @@ -627,16 +627,16 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { return false; } - // checks if it has enough catalyst durabilety + // checks if it has enough catalyst durability ArrayListtCatalysts = null; - int tMaxParrallelCatalyst = aMaxParallelRecipes; + int tMaxParallelCatalyst = aMaxParallelRecipes; if (tCatalystRecipe != null) { tCatalysts = new ArrayList(); - tMaxParrallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts); - log("Can process "+tMaxParrallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability."); + tMaxParallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts); + log("Can process "+tMaxParallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability."); } - if (tMaxParrallelCatalyst == 0) { + if (tMaxParallelCatalyst == 0) { log("found not enough catalysts"); return false; } @@ -650,13 +650,13 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { int parallelRecipes = 0; log("parallelRecipes: "+parallelRecipes); - log("aMaxParallelRecipes: "+tMaxParrallelCatalyst); + log("aMaxParallelRecipes: "+tMaxParallelCatalyst); log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); log("tEnergy: "+tEnergy); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < tMaxParrallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < tMaxParallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; @@ -928,14 +928,14 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList aOutPut) { - int allowedParrallel = 0; + int allowedParallel = 0; for (final ItemStack aInput : aItemInputs) { if (aRecipeCatalyst.isItemEqual(aInput)) { int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput); return Math.min(aMaxParrallel, aDurabilityRemaining); } } - return allowedParrallel; + return allowedParallel; } private ItemStack findCatalyst(ItemStack[] aItemInputs) { @@ -971,9 +971,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { log("not consuming catalyst"); } } - - - } private int getDamage(ItemStack aStack) { @@ -984,8 +981,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { ItemGenericChemBase.setCatalystDamage(aStack, aAmount); } - - @SideOnly(Side.CLIENT) private final int getCasingTierOnClientSide() { @@ -1018,7 +1013,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { t.printStackTrace(); return 0; } - } /* @@ -1036,5 +1030,4 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } return tItems; } - } -- cgit From bd52195d37d390a23646272bd7bed1b5f6fa92e6 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 11:29:53 -0600 Subject: fix red here also --- .../multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index bb22297b28..bcf76964d2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -444,8 +444,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { private int getCasingTextureID() { // Check the Tier Client Side int aTier = mSolidCasingTier; - int aCasingID = getCasingTextureIdForTier(aTier); - return aCasingID; + return getCasingTextureIdForTier(aTier); } public boolean addToMachineList(IGregTechTileEntity aTileEntity) { @@ -583,9 +582,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { //GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); GT_Recipe tRecipe = findRecipe(mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs); - - - if (tRecipe == null) { log("BAD RETURN - 1"); return false; -- cgit From 152a1e1f63851929e6efddd2098fdc775b8ff64f Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 18:35:28 -0600 Subject: fix /GTNewHorizons/GT-New-Horizons-Modpack#6308 --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 7 ------- .../multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index d1ce55d3f2..b1bad97f0b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -40,13 +40,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } - public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { - super(aName, aTier, aInputSlots*2, aDescription[0], aTextures); - mInputslotCount = getInputSlotCount(); - mTotalSlotCount = getInputSlotCount()*2; - mAllowDuplicateUsageTypes = aAllowDuplicateTypes; - } - @Override public abstract ITexture[] getTexturesActive(ITexture aBaseTexture); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 4a2747a3db..65470e0981 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -766,6 +766,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { this.mOutputItems = tOutputItems; this.mOutputFluids = tOutputFluids; updateSlots(); + for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) h.updateSlots(); // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); @@ -960,7 +961,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { if (damage >= getMaxCatalystDurability()) { log("consume catalyst"); addOutput(CI.getEmptyCatalyst(1)); - aStack = null; + aStack.stackSize -= 1; } else { log("damaging catalyst"); -- cgit From 93067011c8289efbff8b9a223021b4e3107235f8 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 20:16:05 -0600 Subject: actually load in a new catalyst if available --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index b1bad97f0b..151b5a1735 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -120,7 +120,8 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE if (i <= getSlotID_LastInput()) { fillStacksIntoFirstSlots(); } - } + } + tryFillUsageSlots(); } // Only moves items in the first four slots -- cgit From af441c7a5f5ceab909c00dd794b7ce25d8925c49 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Thu, 25 Nov 2021 06:30:32 -0600 Subject: correct style --- .../multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 65470e0981..8d778d4e67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -766,7 +766,9 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { this.mOutputItems = tOutputItems; this.mOutputFluids = tOutputFluids; updateSlots(); - for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) h.updateSlots(); + for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) { + h.updateSlots(); + } // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); -- cgit From 2b42cb27f84b23a38c154469575c108da29307b4 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Thu, 25 Nov 2021 06:44:21 -0600 Subject: readd constructor --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 151b5a1735..7c857ac0bf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -40,6 +40,13 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } + public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { + super(aName, aTier, aInputSlots*2, aDescription, aTextures); + mInputslotCount = getInputSlotCount(); + mTotalSlotCount = getInputSlotCount()*2; + mAllowDuplicateUsageTypes = aAllowDuplicateTypes; + } + @Override public abstract ITexture[] getTexturesActive(ITexture aBaseTexture); -- cgit From 0cf66de644598ef44ec662a46eeacb1dffbfd7a8 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 08:32:53 -0600 Subject: turn tryfill public --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 +-- .../machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 7c857ac0bf..56dff1b1e3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -128,7 +128,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } - tryFillUsageSlots(); } // Only moves items in the first four slots @@ -142,7 +141,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } } - private final void tryFillUsageSlots() { + public final void tryFillUsageSlots() { int aSlotSpace = (mInputslotCount - getContentUsageSlots().size()); if (aSlotSpace > 0) { Logger.INFO("We have empty usage slots. "+aSlotSpace); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 8d778d4e67..8c0af73282 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -768,6 +768,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { updateSlots(); for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) { h.updateSlots(); + h.tryFillUsageSlots(); } // Play sounds (GT++ addition - GT multiblocks play no sounds) -- cgit From f19ff7aa5c13c6e4d4e26e5d3f825f30d80c8f9d Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 08:57:46 -0600 Subject: Revert "turn tryfill public" This reverts commit 0cf66de644598ef44ec662a46eeacb1dffbfd7a8. --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 ++- .../machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 56dff1b1e3..7c857ac0bf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -128,6 +128,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } + tryFillUsageSlots(); } // Only moves items in the first four slots @@ -141,7 +142,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } } - public final void tryFillUsageSlots() { + private final void tryFillUsageSlots() { int aSlotSpace = (mInputslotCount - getContentUsageSlots().size()); if (aSlotSpace > 0) { Logger.INFO("We have empty usage slots. "+aSlotSpace); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 8c0af73282..8d778d4e67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -768,7 +768,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { updateSlots(); for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) { h.updateSlots(); - h.tryFillUsageSlots(); } // Play sounds (GT++ addition - GT multiblocks play no sounds) -- cgit From 8744c2c9664d157bb80895ca6d2956931401f1e2 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 09:00:23 -0600 Subject: Revert "Revert "turn tryfill public"" This reverts commit f19ff7aa5c13c6e4d4e26e5d3f825f30d80c8f9d. --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 +-- .../machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 7c857ac0bf..56dff1b1e3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -128,7 +128,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } - tryFillUsageSlots(); } // Only moves items in the first four slots @@ -142,7 +141,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } } - private final void tryFillUsageSlots() { + public final void tryFillUsageSlots() { int aSlotSpace = (mInputslotCount - getContentUsageSlots().size()); if (aSlotSpace > 0) { Logger.INFO("We have empty usage slots. "+aSlotSpace); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 8d778d4e67..8c0af73282 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -768,6 +768,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { updateSlots(); for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) { h.updateSlots(); + h.tryFillUsageSlots(); } // Play sounds (GT++ addition - GT multiblocks play no sounds) -- cgit From 6c2ab27136d4f85e43f8009f037023c475440486 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 27 Nov 2021 01:55:26 -0700 Subject: Fix large semi-fluid generator --- ...techMetaTileEntity_LargeSemifluidGenerator.java | 59 ++++++++++------------ 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 20fd55ef53..dd5e5286b7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -1,7 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; import java.util.ArrayList; -import java.util.Collection; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; @@ -16,7 +15,6 @@ import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; @@ -91,37 +89,36 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tFluids = getStoredFluids(); - Collection tRecipeList = GTPP_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList; - - if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a semifluid fuel? - for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches - for(GT_Recipe aFuel : tRecipeList) { //Loops through semifluid fuel recipes - FluidStack tLiquid; - if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null) { //Create fluidstack from current recipe - if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a semifluid fluid - fuelConsumption = tLiquid.amount = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption - if(depleteInput(tLiquid)) { //Deplete that amount - boostEu = depleteInput(Materials.Oxygen.getGas(4L)); - if(tFluids.contains(Materials.Lubricant.getFluid(2L))) { //Has lubricant? - //Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048) - if(mRuntime % 72 == 0 || mRuntime == 0) { - depleteInput(Materials.Lubricant.getFluid(boostEu ? 2 : 1)); - } - } - else { - return false; - } - - fuelValue = aFuel.mSpecialValue; - fuelRemaining = hatchFluid1.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 15; - return true; - } + + if(tFluids.size() > 0) { //Does input hatch have a semifluid fuel? + for (FluidStack hatchFluid : tFluids) { //Loops through hatches + GT_Recipe aFuel = GTPP_Recipe_Map.sSemiFluidLiquidFuels.findFuel(hatchFluid); + if (aFuel == null) { + // Not a valid semi-fluid fuel. + continue; + } + + fuelConsumption = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption + FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption); + if(depleteInput(tLiquid)) { //Deplete that amount + boostEu = depleteInput(Materials.Oxygen.getGas(4L)); + if(tFluids.contains(Materials.Lubricant.getFluid(2L))) { //Has lubricant? + //Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048) + if(mRuntime % 72 == 0 || mRuntime == 0) { + depleteInput(Materials.Lubricant.getFluid(boostEu ? 2 : 1)); } } + else { + return false; + } + + fuelValue = aFuel.mSpecialValue; + fuelRemaining = hatchFluid.amount; //Record available fuel + this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + this.mProgresstime = 1; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 15; + return true; } } } -- cgit From 64d3f815ae02620dcbf5dbaa2091606f4335d086 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 27 Nov 2021 02:28:10 -0700 Subject: Fix bug with failing to deplete lubricant --- ...techMetaTileEntity_LargeSemifluidGenerator.java | 70 ++++++++++++++-------- 1 file changed, 45 insertions(+), 25 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index dd5e5286b7..ee859ddf3c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -90,38 +90,58 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta public boolean checkRecipe(ItemStack aStack) { ArrayList tFluids = getStoredFluids(); - if(tFluids.size() > 0) { //Does input hatch have a semifluid fuel? - for (FluidStack hatchFluid : tFluids) { //Loops through hatches - GT_Recipe aFuel = GTPP_Recipe_Map.sSemiFluidLiquidFuels.findFuel(hatchFluid); - if (aFuel == null) { - // Not a valid semi-fluid fuel. - continue; - } + // Check for lubricant and oxygen first, so we can compute costs ahead of time. + // This will allow us to check costs without needing to actually try to deplete fluids + // (wasting earlier fluids in the check if later fluids turn out to be insufficient). + FluidStack lubricant = Materials.Lubricant.getFluid(0L); + FluidStack oxygen = Materials.Oxygen.getGas(0L); + for (FluidStack hatchFluid : tFluids) { + if (hatchFluid.isFluidEqual(lubricant)) { + lubricant.amount = Math.max(lubricant.amount, hatchFluid.amount); + } else if (hatchFluid.isFluidEqual(oxygen)) { + oxygen.amount = Math.max(oxygen.amount, hatchFluid.amount); + } + } + boostEu = oxygen.amount >= 4L; + long lubricantCost = boostEu ? 2L : 1L; + if (lubricant.amount < lubricantCost) { + return false; + } + + for (FluidStack hatchFluid : tFluids) { //Loops through hatches + GT_Recipe aFuel = GTPP_Recipe_Map.sSemiFluidLiquidFuels.findFuel(hatchFluid); + if (aFuel == null) { + // Not a valid semi-fluid fuel. + continue; + } - fuelConsumption = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption - FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption); - if(depleteInput(tLiquid)) { //Deplete that amount - boostEu = depleteInput(Materials.Oxygen.getGas(4L)); - if(tFluids.contains(Materials.Lubricant.getFluid(2L))) { //Has lubricant? - //Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048) - if(mRuntime % 72 == 0 || mRuntime == 0) { - depleteInput(Materials.Lubricant.getFluid(boostEu ? 2 : 1)); - } + fuelConsumption = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption + FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption); + if(depleteInput(tLiquid)) { //Deplete that amount + // We checked beforehand, so both of these depletions should succeed. + // But check the return values anyway just to be safe. + if (boostEu) { + if (!depleteInput(Materials.Oxygen.getGas(4L))) { + return false; } - else { + } + //Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048) + if(mRuntime % 72 == 0 || mRuntime == 0) { + if(!depleteInput(Materials.Lubricant.getFluid(lubricantCost))) { return false; } - - fuelValue = aFuel.mSpecialValue; - fuelRemaining = hatchFluid.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 15; - return true; } + + fuelValue = aFuel.mSpecialValue; + fuelRemaining = hatchFluid.amount; //Record available fuel + this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + this.mProgresstime = 1; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 15; + return true; } } + this.mEUt = 0; this.mEfficiency = 0; return false; -- cgit From e99a0e0cef774e2544497426e5834a26d46f45f8 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 27 Nov 2021 03:37:48 -0700 Subject: Update output and efficiency to match tooltip --- .../production/GregtechMetaTileEntity_LargeSemifluidGenerator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index ee859ddf3c..283963ed88 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -115,7 +115,8 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta continue; } - fuelConsumption = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption + int newEUt = boostEu ? 4096 : 2048; + fuelConsumption = newEUt / aFuel.mSpecialValue; //Calc fuel consumption FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption); if(depleteInput(tLiquid)) { //Deplete that amount // We checked beforehand, so both of these depletions should succeed. @@ -134,7 +135,7 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta fuelValue = aFuel.mSpecialValue; fuelRemaining = hatchFluid.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + this.mEUt = mEfficiency < 2000 ? 0 : newEUt; //Output 0 if startup is less than 20% this.mProgresstime = 1; this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 15; @@ -286,7 +287,7 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta } public int getMaxEfficiency(ItemStack aStack) { - return boostEu ? 20000 : 10000; + return boostEu ? 15000 : 10000; } @Override -- cgit From 648d073301c771e385f4b36049cc77b4fadc662c Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Mon, 29 Nov 2021 02:20:03 +0100 Subject: extracted pollution values to CORE.ConfigSwitches --- .../base/GregtechMeta_MultiBlockBase.java | 4 ---- .../machines/multi/misc/GMTE_AmazonPackager.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialAlloySmelter.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialArcFurnace.java | 8 ++++---- .../GregtechMetaTileEntity_IndustrialCentrifuge.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialCuttingMachine.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialDehydrator.java | 10 ++++------ .../GregtechMetaTileEntity_IndustrialElectrolyzer.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialExtruder.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialMacerator.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialMixer.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialMultiMachine.java | 16 +++++++--------- .../GregtechMetaTileEntity_IndustrialPlatePress.java | 8 +++++--- .../GregtechMetaTileEntity_IndustrialSifter.java | 7 ++++--- ...egtechMetaTileEntity_IndustrialThermalCentrifuge.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialVacuumFreezer.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialWashPlant.java | 8 +++++--- .../GregtechMetaTileEntity_IndustrialWireMill.java | 7 ++++--- .../multi/processing/GregtechMetaTileEntity_IsaMill.java | 7 ++++--- .../GregtechMetaTileEntity_Adv_DistillationTower.java | 8 +++++--- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 7 ++++--- .../advanced/GregtechMetaTileEntity_Adv_Implosion.java | 7 ++++--- .../machines/multi/production/GT4Entity_AutoCrafter.java | 6 +++--- .../multi/production/GT4Entity_ThermalBoiler.java | 7 ++++--- .../multi/production/GregtechMTE_FrothFlotationCell.java | 7 ++++--- .../multi/production/GregtechMTE_NuclearReactor.java | 8 +++++--- .../multi/production/GregtechMetaTileEntityTreeFarm.java | 11 ++++------- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 7 ++++--- .../production/GregtechMetaTileEntity_Cyclotron.java | 7 ++++--- .../GregtechMetaTileEntity_IndustrialFishingPond.java | 6 +++--- .../GregtechMetaTileEntity_LargeSemifluidGenerator.java | 7 ++++--- .../GregtechMetaTileEntity_MassFabricator.java | 7 ++++--- .../production/GregtechMetaTileEntity_Refinery.java | 7 ++++--- .../production/algae/GregtechMTE_AlgaePondBase.java | 7 ++++--- 35 files changed, 141 insertions(+), 120 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') 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 3878583b60..0b8182c64a 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 @@ -2159,10 +2159,6 @@ public abstract class GregtechMeta_MultiBlockBase