Skip to content

Commit

Permalink
Buff crafting storage usage of EMC, add config option for EMC per byte
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed May 12, 2024
1 parent 9287f7d commit 2a71689
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/java/gripe/_90/appliede/AppliedEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ public class AppliedEConfig {
}

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

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);
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",
"amounts of crafting storage for some jobs.")
.defineInRange("emcPerByte", 1000000, 1, Integer.MAX_VALUE);
terminalExtractFromOwnEmcOnly = builder.comment(
"When extracting items from a Transmutation Terminal via EMC, deduct EMC only",
"from the player using the terminal rather than all players with modules attached.",
Expand All @@ -29,6 +35,10 @@ public double getModuleEnergyUsage() {
return moduleEnergyUsage.get();
}

public int getEmcPerByte() {
return emcPerByte.get();
}

public boolean terminalExtractFromOwnEmcOnly() {
return terminalExtractFromOwnEmcOnly.get();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gripe/_90/appliede/me/key/EMCKeyType.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import appeng.api.stacks.AEKeyType;

import gripe._90.appliede.AppliedE;
import gripe._90.appliede.AppliedEConfig;

public final class EMCKeyType extends AEKeyType {
public static final EMCKeyType TYPE = new EMCKeyType();
Expand All @@ -29,7 +30,7 @@ public AEKey loadKeyFromTag(CompoundTag tag) {

@Override
public int getAmountPerByte() {
return Integer.MAX_VALUE;
return AppliedEConfig.CONFIG.getEmcPerByte();
}

@Override
Expand Down

0 comments on commit 2a71689

Please sign in to comment.