From 3eab6818b76d13d6669dd0163e732164852d8d0f Mon Sep 17 00:00:00 2001 From: James103 <37945304+James103@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:14:16 -0500 Subject: [PATCH] Add config option to multiply EMC transmutation energy cost Fixes #20. --- src/main/java/gripe/_90/appliede/AppliedEConfig.java | 8 ++++++++ .../java/gripe/_90/appliede/me/service/EMCStorage.java | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/gripe/_90/appliede/AppliedEConfig.java b/src/main/java/gripe/_90/appliede/AppliedEConfig.java index e840e26..b16518d 100644 --- a/src/main/java/gripe/_90/appliede/AppliedEConfig.java +++ b/src/main/java/gripe/_90/appliede/AppliedEConfig.java @@ -13,6 +13,7 @@ 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; @@ -20,6 +21,9 @@ public class AppliedEConfig { 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", @@ -39,6 +43,10 @@ public double getModuleEnergyUsage() { return moduleEnergyUsage.get(); } + public double getTransmutationPowerMultiplier() { + return transmutationPowerMultiplier.get(); + } + public int getEmcPerByte() { return emcPerByte.get(); } diff --git a/src/main/java/gripe/_90/appliede/me/service/EMCStorage.java b/src/main/java/gripe/_90/appliede/me/service/EMCStorage.java index 4046568..a9554be 100644 --- a/src/main/java/gripe/_90/appliede/me/service/EMCStorage.java +++ b/src/main/java/gripe/_90/appliede/me/service/EMCStorage.java @@ -322,7 +322,8 @@ private List 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);