Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Fix Algae Farm compost calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonodonozym committed Aug 22, 2023
1 parent 41a28b0 commit 02bc80f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private boolean isUsingCompost(ItemStack[] aItemInputs) {
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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public static GT_Recipe getTieredRecipeFromCache(int aTier, boolean aCompost) {
Logger.INFO("Using recipe with index of " + aIndex + ". " + aComp);
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) {

Expand Down Expand Up @@ -81,7 +85,7 @@ private static GT_Recipe generateBaseRecipe(boolean aUsingCompost, int aTier) {
// 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);
compostForTier(aTier));
aInputs = new ItemStack[] { aCompost };
// Boost Tier by one if using compost so it gets a speed boost
aTier++;
Expand Down

0 comments on commit 02bc80f

Please sign in to comment.