Skip to content

Commit

Permalink
Add worldgen category to GrowthcraftMilkConfig
Browse files Browse the repository at this point in the history
Configurations for the generation of Growthcraft Milk village structures have been added to the code. Features added include the ability to enable or disable this feature and adjust the weight of the village structures.
  • Loading branch information
Alatyami committed Jun 23, 2024
1 parent 9dbebcd commit 1b298d5
Showing 1 changed file with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class GrowthcraftMilkConfig {
private static final String CATEGORY_MIXING_VAT = "mixing_vat";
private static final String CATEGORY_PANCHEON = "pancheon";
private static final String CATEGORY_LOOT_CHANCES = "loot_modifiers";
private static final String CATEGORY_WORLDGEN = "worldgen";

private static ForgeConfigSpec.BooleanValue churnGuiEnabled;
private static ForgeConfigSpec.BooleanValue mixingVatGuiEnabled;
Expand All @@ -28,6 +29,9 @@ public class GrowthcraftMilkConfig {
private static ForgeConfigSpec.BooleanValue stomachLootEnabled;
private static ForgeConfigSpec.IntValue stomachLootChance;

private static ForgeConfigSpec.BooleanValue villageStructuresEnabled;
private static ForgeConfigSpec.IntValue villageStructuresWeight;

static {
initServerConfig(SERVER_BUILDER);
SERVER = SERVER_BUILDER.build();
Expand Down Expand Up @@ -73,6 +77,14 @@ public static void initServerConfig(ForgeConfigSpec.Builder specBuilder) {
stomachLootChance = specBuilder
.comment("Chance to loot a stomach from a cow. stomachLootEnabled must be set to true.")
.defineInRange(String.format("%s.%s", CATEGORY_LOOT_CHANCES, "stomachLootChance"), 5, 0, 100);

villageStructuresEnabled = specBuilder
.comment("Enable generation of Growthcraft Milk village structures.")
.define(String.format("%s.%s", CATEGORY_WORLDGEN, "villageStructuresEnabled"), false);
villageStructuresWeight = specBuilder
.comment("The weight of the villager structures.")
.defineInRange(String.format("%s.%s", CATEGORY_WORLDGEN, "villageStructuresWeight"), 10, 0, 16000);

}

public static boolean isChurnGuiEnabled() {
Expand All @@ -86,16 +98,28 @@ public static boolean isPancheonGuiEnabled() {
public static boolean isMixingVatGuiEnabled() {
return mixingVatGuiEnabled.get();
}

public static boolean isMixingDebugEnabled() {
return mixingVatDebugEnabled.get();
}


public static boolean isConsumeMixingVatActivator() {
return mixingVatConsumeActivationItem.get();
}

public static boolean isStomachLootingEnabled() { return stomachLootEnabled.get(); }
public static boolean isStomachLootingEnabled() {
return stomachLootEnabled.get();
}

public static int getStomachLootChance() { return stomachLootChance.get();}
public static int getStomachLootChance() {
return stomachLootChance.get();
}

public static boolean getVillageStructuresEnabled() {
return villageStructuresEnabled.get();
}

public static int getVillageStructuresWeight() {
return villageStructuresWeight.get();
}
}

0 comments on commit 1b298d5

Please sign in to comment.