feat: add more config options
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Timo Ley 2023-01-21 19:57:35 +01:00
parent 816a5b7523
commit 5c38b79d9c
3 changed files with 15 additions and 8 deletions

View file

@ -24,7 +24,7 @@ apply from: './gradle/scripts/mixins.gradle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = "1.5.0"
version = "1.6.0"
group= "dev.tilera.modding"
archivesBaseName = "cwg"

View file

@ -16,6 +16,8 @@ public class Config {
public static boolean classicExtremeHills = false;
public static boolean disableHeightTemperature = false;
public static boolean enableFarlands = false;
public static boolean disableJungle = false;
public static boolean disableModdedBiomes = false;
public static void initConfig() {
conf = new Configuration(new File(Loader.instance().getConfigDir(), "ClassicWorldgen.cfg"));
@ -28,6 +30,8 @@ public class Config {
disableHeightTemperature = conf.getBoolean("disableHeightTemperature", "tweaks", disableHeightTemperature, "disable snow on mountains");
changeWorldTypeCommand = conf.getBoolean("changeTypeCommand", "commands", changeWorldTypeCommand, "enable command to change the WorldType");
enableFarlands = conf.getBoolean("enableFarlands", "tweaks", enableFarlands, "reenable the Farlands!");
disableJungle = conf.getBoolean("disableJungle", "worldgen", disableJungle, "prevent jungle biomes from generating in classic worldgen");
disableModdedBiomes = conf.getBoolean("disableModdedBiomes", "worldgen", disableModdedBiomes, "prevent modded biomes from generating in classic worldgen");
conf.save();
}

View file

@ -30,6 +30,7 @@ public class GenLayerBiomeClassic extends GenLayer {
ArrayList<BiomeEntry> biomeEntries = new ArrayList<>();
for (BiomeGenBase b : vanillaBiomes) {
if (Config.disableJungle && b == BiomeGenBase.jungle) continue;
addedBiomes.add(b);
biomeEntries.add(new BiomeEntry(b, 10));
}
@ -53,13 +54,15 @@ public class GenLayerBiomeClassic extends GenLayer {
addedBiomes.add(BiomeGenBase.megaTaiga);
}
for (BiomeType t : BiomeType.values()) {
ImmutableList<BiomeEntry> biomesToAdd = BiomeManager.getBiomes(t);
for (BiomeEntry biome : biomesToAdd) {
if ((biome.biome.biomeID < 40 && Config.blockNewVanillaBiomes) || addedBiomes.contains(biome.biome)) continue;
addedBiomes.add(biome.biome);
biomeEntries.add(biome);
if (biome.itemWeight != 10) hasBiomeWeights = true;
if (!Config.disableModdedBiomes) {
for (BiomeType t : BiomeType.values()) {
ImmutableList<BiomeEntry> biomesToAdd = BiomeManager.getBiomes(t);
for (BiomeEntry biome : biomesToAdd) {
if ((biome.biome.biomeID < 40 && Config.blockNewVanillaBiomes) || addedBiomes.contains(biome.biome)) continue;
addedBiomes.add(biome.biome);
biomeEntries.add(biome);
if (biome.itemWeight != 10) hasBiomeWeights = true;
}
}
}
allowedBiomes = biomeEntries.toArray(new BiomeEntry[biomeEntries.size()]);