Skip to content

Commit

Permalink
feat: add config for enabling unlimited flesh growth near cradles
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Nov 3, 2023
1 parent 5999030 commit 826c988
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ public void addPrimalEnergy(ServerLevel level, int amount) {

public boolean consumePrimalEnergy(ServerLevel level, int amount) {
if (amount <= 0) return false;
if (primalSpreadCharge < amount) return false;

PrimalEnergySettings.SupplyAmount supplyAmount = BiomancyConfig.SERVER.primalEnergySupplyOfCradle.get();
if (supplyAmount == PrimalEnergySettings.SupplyAmount.UNLIMITED) return true;
if (supplyAmount == PrimalEnergySettings.SupplyAmount.NONE) return false;

if (primalEnergy < amount) return false;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.github.elenterius.biomancy.config;

public final class PrimalEnergySettings {

private PrimalEnergySettings() {}

public enum SupplyAmount {
NONE, LIMITED, UNLIMITED
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class ServerConfig {
public final ForgeConfigSpec.BooleanValue doBioForgeRecipeProgression;
public final ForgeConfigSpec.BooleanValue addTradesToVillagers;
public final ForgeConfigSpec.BooleanValue addTradesToWanderingTrader;
// public final ForgeConfigSpec.BooleanValue decreasePrimalEnergyOfGrowth;
public final ForgeConfigSpec.EnumValue<PrimalEnergySettings.SupplyAmount> primalEnergySupplyOfCradle;

public ServerConfig(ForgeConfigSpec.Builder builder) {
builder.push("recipes");
Expand All @@ -28,6 +30,18 @@ public ServerConfig(ForgeConfigSpec.Builder builder) {
.define("addTradesToWanderingTrader", true);

builder.pop();

builder.push("flesh-growth");

// decreasePrimalEnergyOfGrowth = builder
// .comment("Determines if the BioForge recipes need to be unlocked to be able to craft them")
// .define("decreasePrimalEnergyOfGrowth", true);

primalEnergySupplyOfCradle = builder
.comment("Determines how much primal energy the Cradle can supply to nearby malignant flesh veins")
.defineEnum("primalEnergySupplyOfCradle", PrimalEnergySettings.SupplyAmount.LIMITED);

builder.pop();
}

}

0 comments on commit 826c988

Please sign in to comment.