diff options
author | Jaiden Baker <jaidencolebaker@gmail.com> | 2023-08-23 08:06:28 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-22 22:06:28 +0200 |
commit | 565ef33c14f8f39e9f347f532609f2053309110c (patch) | |
tree | 08c82cd8c7ba1d139f4a9386a4617b79fcf6d07c /src | |
parent | 41a28b0ebc1b6e1d5c3484d932f3f238fa2d92f6 (diff) | |
download | GT5-Unofficial-565ef33c14f8f39e9f347f532609f2053309110c.tar.gz GT5-Unofficial-565ef33c14f8f39e9f347f532609f2053309110c.tar.bz2 GT5-Unofficial-565ef33c14f8f39e9f347f532609f2053309110c.zip |
Fix Algae Farm compost calculation (#726)
* Fix Algae Farm compost calculation
* Spotless
Diffstat (limited to 'src')
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 8b1e53fe89..a0225e7d48 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -334,7 +334,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1); for (ItemStack i : aItemInputs) { if (GT_Utility.areStacksEqual(aCompost, i)) { - if (i.stackSize >= 8) { + if (i.stackSize >= RecipeLoader_AlgaeFarm.compostForTier(mLevel)) { return true; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java index 379d8acda0..7ca8d4d78e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java @@ -51,6 +51,10 @@ public class RecipeLoader_AlgaeFarm { return aTemp.get(aIndex); } + public static int compostForTier(int aTier) { + return aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier - 1)) : 1; + } + private static GT_Recipe generateBaseRecipe(boolean aUsingCompost, int aTier) { // Type Safety @@ -79,9 +83,7 @@ public class RecipeLoader_AlgaeFarm { if (aUsingCompost) { // Make it use 4 compost per tier if we have some available // Compost consumption maxes out at 1 stack per cycle - ItemStack aCompost = ItemUtils.getSimpleStack( - AgriculturalChem.mCompost, - aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier - 1)) : 1); + ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, compostForTier(aTier)); aInputs = new ItemStack[] { aCompost }; // Boost Tier by one if using compost so it gets a speed boost aTier++; |