Skip to content

Commit

Permalink
Change cloud generation to whitelists
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed May 19, 2024
1 parent bdd2adb commit 31ae0c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/main/java/com/progwml6/natura/common/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ public static boolean syncConfig()
// Berries End

// Cloud Start
cloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(clouds)", cloudBlacklist).getIntList();
darkCloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(dark clouds)", darkCloudBlacklist).getIntList();
ashBlacklist = configFile.get(WORLDGEN, "dimension blacklist(ash clouds)", ashBlacklist).getIntList();
sulfurCloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(sulfur clouds)", sulfurCloudBlacklist).getIntList();
cloudWhitelist = configFile.get(WORLDGEN, "dimension blacklist(clouds)", cloudWhitelist).getIntList();
darkCloudWhitelist = configFile.get(WORLDGEN, "dimension blacklist(dark clouds)", darkCloudWhitelist).getIntList();
ashWhitelist = configFile.get(WORLDGEN, "dimension blacklist(ash clouds)", ashWhitelist).getIntList();
sulfurCloudWhitelist = configFile.get(WORLDGEN, "dimension blacklist(sulfur clouds)", sulfurCloudWhitelist).getIntList();

cloudSpawnRarity = configFile.get(WORLDGEN, "Cloud Spawn Rarity", cloudSpawnRarity).getInt(cloudSpawnRarity);
cloudSpawnHeight = configFile.get(WORLDGEN, "Cloud Spawn Height", cloudSpawnHeight).getInt(cloudSpawnHeight);
Expand Down Expand Up @@ -268,10 +268,10 @@ public static boolean syncConfig()
public static boolean generateAshClouds = true;
public static boolean generateDarkClouds = true;

public static int[] cloudBlacklist = new int[] {};
public static int[] darkCloudBlacklist = new int[] {};
public static int[] ashBlacklist = new int[] {};
public static int[] sulfurCloudBlacklist = new int[] {};
public static int[] cloudWhitelist = new int[] {0};
public static int[] darkCloudWhitelist = new int[] {1};
public static int[] ashWhitelist = new int[] {-1};
public static int[] sulfurCloudWhitelist = new int[] {-1};

public static boolean enableCloudBlocks = false;
public static int cloudSpawnRarity = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void generateOverworld(Random random, int chunkX, int chunkZ, World world

Biome biome = world.getChunk(chunkPos).getBiome(chunkPos, world.getBiomeProvider());

if (Config.generateOverworldClouds && biome.getRainfall() > 0.15f && random.nextInt(Config.cloudSpawnRarity) == 0 && world.provider.getDimension() != 1 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.cloudBlacklist))
if (Config.generateOverworldClouds && biome.getRainfall() > 0.15f && random.nextInt(Config.cloudSpawnRarity) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.cloudWhitelist))
{
xSpawn = xPos + random.nextInt(16);
ySpawn = random.nextInt(Config.cloudSpawnRange) + Config.cloudSpawnHeight;
Expand Down Expand Up @@ -147,7 +147,7 @@ public void generateNether(Random random, int chunkX, int chunkZ, World world)

if (world.provider.doesWaterVaporize())
{
if (Config.generateAshClouds && random.nextInt(Config.ashSpawnRarity) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.ashBlacklist))
if (Config.generateAshClouds && random.nextInt(Config.ashSpawnRarity) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.ashWhitelist))
{
xSpawn = xPos + random.nextInt(16);
ySpawn = random.nextInt(Config.ashSpawnRange) + Config.ashSpawnHeight;
Expand Down Expand Up @@ -178,7 +178,7 @@ else if (size < 11)
}
}

if (Config.generateSulfurClouds && random.nextInt(Config.sulfurSpawnRarity) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.sulfurCloudBlacklist))
if (Config.generateSulfurClouds && random.nextInt(Config.sulfurSpawnRarity) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.sulfurCloudWhitelist))
{
xSpawn = xPos + random.nextInt(16);
ySpawn = random.nextInt(Config.sulfurSpawnRange) + Config.sulfurSpawnHeight;
Expand Down Expand Up @@ -226,7 +226,7 @@ public void generateEnd(Random random, int chunkX, int chunkZ, World world)

Biome biome = world.getChunk(chunkPos).getBiome(chunkPos, world.getBiomeProvider());

if (Config.generateDarkClouds && biome == Biomes.SKY && world.provider.getDimension() == 1 && random.nextInt(4) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.darkCloudBlacklist))
if (Config.generateDarkClouds && biome == Biomes.SKY && random.nextInt(4) == 0 && this.shouldGenerateInDimension(world.provider.getDimension(), Config.darkCloudWhitelist))
{
xSpawn = xPos + random.nextInt(16);
zSpawn = zPos + random.nextInt(16);
Expand Down Expand Up @@ -264,10 +264,10 @@ public boolean shouldGenerateInDimension(int dimension, int[] configSetting)
{
if (dimension == dimensionId)
{
return false;
return true;
}
}

return true;
return false;
}
}

0 comments on commit 31ae0c2

Please sign in to comment.