Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pump overflow. #84

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.gtnewhorizons.gtnhintergalactic.tile.multi.elevatormodules;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -31,6 +30,7 @@
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.recipe.check.CheckRecipeResultRegistry;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.ParallelHelper;
import gregtech.common.tileentities.machines.MTEHatchOutputME;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;
import tectech.thing.metaTileEntity.multi.base.INameFunction;
Expand Down Expand Up @@ -127,7 +127,7 @@ public TileEntityModulePump(String aName, int tTier, int tModuleTier, int tMinMo
.insufficientPower(ENERGY_CONSUMPTION * getParallelRecipes() * getParallels());
}

List<FluidStack> outputs = new ArrayList<>();
ArrayList<FluidStack> outputs = new ArrayList<>();
int usedEUt = 0;
// We store the highest batch size as time multiplier
int maxBatchSize = (int) Math.min(Math.max(batchSetting.get(), 1.0D), 128.0D);
Expand Down Expand Up @@ -160,9 +160,9 @@ public TileEntityModulePump(String aName, int tTier, int tModuleTier, int tMinMo
}
if (parallels > 0 && batchSize > 0) {
fluid = fluid.copy();
fluid.amount = fluid.amount * parallels * batchSize;
usedEUt += ENERGY_CONSUMPTION * parallels;
outputs.add(fluid);
long fluidLong = (long) fluid.amount * parallels * batchSize;
usedEUt += (int) (ENERGY_CONSUMPTION * parallels);
ParallelHelper.addFluidsLong(outputs, fluid, fluidLong);
}
}
}
Expand All @@ -173,7 +173,7 @@ public TileEntityModulePump(String aName, int tTier, int tModuleTier, int tMinMo
mEfficiencyIncrease = 10000;
mMaxProgresstime = 20 * maxBatchSize;

return outputs.size() > 0 ? CheckRecipeResultRegistry.SUCCESSFUL : CheckRecipeResultRegistry.NO_RECIPE;
return !outputs.isEmpty() ? CheckRecipeResultRegistry.SUCCESSFUL : CheckRecipeResultRegistry.NO_RECIPE;
}

/**
Expand Down