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

Add config option to multiply EMC transmutation energy cost #21

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions src/main/java/gripe/_90/appliede/AppliedEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ public class AppliedEConfig {
}

private final ForgeConfigSpec.DoubleValue moduleEnergyUsage;
private final ForgeConfigSpec.DoubleValue transmutationPowerMultiplier;
private final ForgeConfigSpec.IntValue emcPerByte;
private final ForgeConfigSpec.BooleanValue terminalExtractFromOwnEmcOnly;
private final ForgeConfigSpec.IntValue syncThrottleInterval;

private AppliedEConfig(ForgeConfigSpec.Builder builder) {
moduleEnergyUsage = builder.comment("The amount of AE energy per tick used by the ME Transmutation Module.")
.defineInRange("moduleEnergyUsage", 25.0, 0, Double.MAX_VALUE);
transmutationPowerMultiplier = builder.comment(
"The amount of AE energy used to transmute 1 EMC through the ME Transmutation Module.")
.defineInRange("transmutationPowerMultiplier", 1.0, 0, Double.MAX_VALUE);
emcPerByte = builder.comment(
"The number of EMC units (of any tier) per byte as used in AE2 auto-crafting.",
"It is not recommended to set this very low as this will require unreasonably large",
Expand All @@ -39,6 +43,10 @@ public double getModuleEnergyUsage() {
return moduleEnergyUsage.get();
}

public double getTransmutationPowerMultiplier() {
return transmutationPowerMultiplier.get();
}

public int getEmcPerByte() {
return emcPerByte.get();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gripe/_90/appliede/me/service/EMCStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ private List<IKnowledgeProvider> getProvidersForExtraction(IActionSource source)

private long getAmountAfterPowerExpenditure(BigInteger maxEmc, BigInteger itemEmc) {
var energyService = service.getGrid().getEnergyService();
var multiplier = BigDecimal.valueOf(PowerMultiplier.CONFIG.multiplier);
var multiplier = BigDecimal.valueOf(PowerMultiplier.CONFIG.multiplier)
.multiply(BigDecimal.valueOf(AppliedEConfig.CONFIG.getTransmutationPowerMultiplier()));
var toExpend = new BigDecimal(maxEmc).multiply(multiplier).min(BigDecimal.valueOf(Double.MAX_VALUE));

var available = energyService.extractAEPower(toExpend.doubleValue(), Actionable.SIMULATE, PowerMultiplier.ONE);
Expand Down
Loading