Skip to content

Commit

Permalink
Add configs for caves, mineshafts, underground lakes, and villages (#9)
Browse files Browse the repository at this point in the history
* update bs + deps

* spotless

* update gradle

* remove wildcard import

* Add configs for caves, mineshafts, underground lakes, and villages
  • Loading branch information
Caedis authored Nov 22, 2023
1 parent 8b41ca9 commit dbf07ca
Show file tree
Hide file tree
Showing 17 changed files with 693 additions and 239 deletions.
735 changes: 548 additions & 187 deletions build.gradle

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Add your dependencies here

dependencies {
compile("com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev")
compile("com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev")

compile('curse.maven:biomes-o-plenty-220318:2499612')
compileOnly('curse.maven:extrabiomesxl-60041:2273301')
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 8 additions & 8 deletions src/main/java/rwg/RWG.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.MinecraftForge;

import rwg.biomes.base.BaseBiomes;
import rwg.commands.RwgBugInfoCommand;
import rwg.commands.RwgNoiseCommand;
import rwg.config.ConfigRWG;
import rwg.data.VillageMaterials;
import rwg.handlers.LoginHandler;
import rwg.support.Support;
import rwg.world.WorldTypeRealistic;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
Expand All @@ -21,6 +13,14 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import rwg.biomes.base.BaseBiomes;
import rwg.commands.RwgBugInfoCommand;
import rwg.commands.RwgNoiseCommand;
import rwg.config.ConfigRWG;
import rwg.data.VillageMaterials;
import rwg.handlers.LoginHandler;
import rwg.support.Support;
import rwg.world.WorldTypeRealistic;

@Mod(modid = "RWG", name = "RealisticWorldGen", version = "GRADLETOKEN_VERSION", acceptableRemoteVersions = "*")
public class RWG {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rwg/biomes/base/BaseBiomeHotForest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.biome.BiomeGenBase;

import rwg.data.VillageMaterialData;
import rwg.data.VillageMaterials;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import rwg.data.VillageMaterialData;
import rwg.data.VillageMaterials;

public class BaseBiomeHotForest extends BiomeGenBase {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/rwg/biomes/base/BaseBiomeHotPlains.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.biome.BiomeGenBase;

import rwg.data.VillageMaterialData;
import rwg.data.VillageMaterials;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import rwg.data.VillageMaterialData;
import rwg.data.VillageMaterials;

public class BaseBiomeHotPlains extends BiomeGenBase {

Expand Down
29 changes: 26 additions & 3 deletions src/main/java/rwg/biomes/realistic/RealisticBiomeBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
import net.minecraft.world.biome.BiomeGenBase;

import rwg.api.RWGBiomes;
import rwg.biomes.realistic.coast.*;
import rwg.biomes.realistic.coast.RealisticBiomeCoastColdCliff;
import rwg.biomes.realistic.coast.RealisticBiomeCoastColdSlope;
import rwg.biomes.realistic.coast.RealisticBiomeCoastDunes;
import rwg.biomes.realistic.coast.RealisticBiomeCoastIce;
import rwg.biomes.realistic.coast.RealisticBiomeCoastMangrove;
import rwg.biomes.realistic.coast.RealisticBiomeCoastOasis;
import rwg.biomes.realistic.coast.RealisticBiomeCoastTest;
import rwg.biomes.realistic.desert.RealisticBiomeDesert;
import rwg.biomes.realistic.desert.RealisticBiomeDesertMountains;
import rwg.biomes.realistic.desert.RealisticBiomeDuneValley;
Expand All @@ -17,8 +23,25 @@
import rwg.biomes.realistic.forest.RealisticBiomeDarkRedwoodPlains;
import rwg.biomes.realistic.forest.RealisticBiomeWoodHills;
import rwg.biomes.realistic.forest.RealisticBiomeWoodMountains;
import rwg.biomes.realistic.land.*;
import rwg.biomes.realistic.ocean.*;
import rwg.biomes.realistic.land.RealisticBiomeHighRainforest;
import rwg.biomes.realistic.land.RealisticBiomeHotRedwood;
import rwg.biomes.realistic.land.RealisticBiomeJungleCanyon;
import rwg.biomes.realistic.land.RealisticBiomeJungleHills;
import rwg.biomes.realistic.land.RealisticBiomePolar;
import rwg.biomes.realistic.land.RealisticBiomeRedwood;
import rwg.biomes.realistic.land.RealisticBiomeRedwoodJungle;
import rwg.biomes.realistic.land.RealisticBiomeRedwoodSnow;
import rwg.biomes.realistic.land.RealisticBiomeSnowHills;
import rwg.biomes.realistic.land.RealisticBiomeSnowLakes;
import rwg.biomes.realistic.land.RealisticBiomeSnowRivers;
import rwg.biomes.realistic.land.RealisticBiomeTaigaHills;
import rwg.biomes.realistic.land.RealisticBiomeTaigaPlains;
import rwg.biomes.realistic.land.RealisticBiomeTest;
import rwg.biomes.realistic.land.RealisticBiomeTestRiver;
import rwg.biomes.realistic.land.RealisticBiomeTundraHills;
import rwg.biomes.realistic.land.RealisticBiomeTundraPlains;
import rwg.biomes.realistic.ocean.RealisticBiomeIslandTropical;
import rwg.biomes.realistic.ocean.RealisticBiomeOceanTest;
import rwg.biomes.realistic.red.RealisticBiomeCanyon;
import rwg.biomes.realistic.red.RealisticBiomeMesa;
import rwg.biomes.realistic.red.RealisticBiomeRedDesertMountains;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/rwg/config/ConfigRWG.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class ConfigRWG {

public static boolean generateEmeralds = true;
public static boolean enableCobblestoneBoulders = true;
public static boolean generateCaves = true;
public static boolean generateMineshafts = true;
public static boolean generateVillages = true;
public static boolean generateUndergroundLakes = true;
public static boolean generateUndergroundLavaLakes = true;

public static void init(FMLPreInitializationEvent event) {
config = new Configuration(event.getSuggestedConfigurationFile());
Expand Down Expand Up @@ -52,6 +57,11 @@ public static void init(FMLPreInitializationEvent event) {

generateEmeralds = config.getBoolean("Generate Emeralds", "Settings", true, "");
enableCobblestoneBoulders = config.getBoolean("Enable Cobblestone Boulders", "Settings", true, "");
generateCaves = config.getBoolean("Generate Caves", "Settings", true, "");
generateMineshafts = config.getBoolean("Generate Mineshafts", "Settings", true, "");
generateVillages = config.getBoolean("Generate Villages", "Settings", true, "");
generateUndergroundLakes = config.getBoolean("Generate Underground Lakes", "Settings", true, "");
generateUndergroundLavaLakes = config.getBoolean("Generate Underground Lava Lakes", "Settings", true, "");

} catch (Exception e) {
for (int c = 0; c < biomeIDs.length; c++) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rwg/data/TreeReplacement.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import net.minecraft.init.Blocks;
import net.minecraftforge.event.terraingen.SaplingGrowTreeEvent;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import rwg.RWG;
import rwg.deco.trees.DecoSavannah;
import rwg.deco.trees.DecoSmallPine;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class TreeReplacement {
/*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rwg/support/Support.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.util.ArrayList;

import rwg.biomes.realistic.RealisticBiomeBase;
import cpw.mods.fml.common.Loader;
import rwg.biomes.realistic.RealisticBiomeBase;

public class Support {

Expand Down
24 changes: 20 additions & 4 deletions src/main/java/rwg/support/SupportBOP.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@

import net.minecraft.init.Blocks;

import biomesoplenty.api.content.BOPCBiomes;
import rwg.api.RWGBiomes;
import rwg.support.Support.BiomeCategory;
import rwg.support.edit.*;
import rwg.surface.*;
import rwg.support.edit.EditBase;
import rwg.support.edit.EditRiverOasis;
import rwg.surface.SurfaceBase;
import rwg.surface.SurfaceCanyon;
import rwg.surface.SurfaceDuneValley;
import rwg.surface.SurfaceGrassland;
import rwg.surface.SurfaceGrasslandMix1;
import rwg.surface.SurfaceMountainSnow;
import rwg.surface.SurfaceMountainStone;
import rwg.surface.river.SurfaceRiverOasis;
import rwg.terrain.*;
import biomesoplenty.api.content.BOPCBiomes;
import rwg.terrain.TerrainCanyon;
import rwg.terrain.TerrainDuneValley;
import rwg.terrain.TerrainGrasslandHills;
import rwg.terrain.TerrainHighland;
import rwg.terrain.TerrainHilly;
import rwg.terrain.TerrainMarsh;
import rwg.terrain.TerrainMountainRiver;
import rwg.terrain.TerrainMountainSpikes;
import rwg.terrain.TerrainSwampMountain;
import rwg.terrain.TerrainSwampRiver;

public class SupportBOP {

Expand Down
25 changes: 21 additions & 4 deletions src/main/java/rwg/support/SupportEBXL.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@

import net.minecraft.init.Blocks;

import extrabiomes.api.BiomeManager;
import rwg.api.RWGBiomes;
import rwg.support.Support.BiomeCategory;
import rwg.support.edit.*;
import rwg.surface.*;
import rwg.support.edit.EditBase;
import rwg.support.edit.EditRiverOasis;
import rwg.surface.SurfaceBase;
import rwg.surface.SurfaceDesertMountain;
import rwg.surface.SurfaceGrassland;
import rwg.surface.SurfaceGrasslandMix1;
import rwg.surface.SurfaceMarshFix;
import rwg.surface.SurfaceMountainSnow;
import rwg.surface.SurfaceMountainStone;
import rwg.surface.SurfacePolar;
import rwg.surface.river.SurfaceRiverOasis;
import rwg.terrain.*;
import extrabiomes.api.BiomeManager;
import rwg.terrain.TerrainGrasslandFlats;
import rwg.terrain.TerrainGrasslandHills;
import rwg.terrain.TerrainHighland;
import rwg.terrain.TerrainHilly;
import rwg.terrain.TerrainMarsh;
import rwg.terrain.TerrainMountainRiver;
import rwg.terrain.TerrainMountainSpikes;
import rwg.terrain.TerrainPolar;
import rwg.terrain.TerrainSwampMountain;
import rwg.terrain.TerrainSwampRiver;

public class SupportEBXL {

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/rwg/surface/SurfaceCanyon.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;

import rwg.util.*;
import rwg.util.CellNoise;
import rwg.util.CliffCalculator;
import rwg.util.NoiseGenerator;
import rwg.util.NoiseSelector;

public class SurfaceCanyon extends SurfaceBase {

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/rwg/surface/SurfaceMesa.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;

import rwg.util.*;
import rwg.util.CellNoise;
import rwg.util.CliffCalculator;
import rwg.util.NoiseGenerator;
import rwg.util.NoiseSelector;

public class SurfaceMesa extends SurfaceBase {

Expand Down
65 changes: 43 additions & 22 deletions src/main/java/rwg/world/ChunkGeneratorRealistic.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;

import cpw.mods.fml.common.eventhandler.Event.Result;
import rwg.biomes.realistic.RealisticBiomeBase;
import rwg.config.ConfigRWG;
import rwg.deco.DecoClay;
import rwg.util.*;
import cpw.mods.fml.common.eventhandler.Event.Result;
import rwg.util.CanyonColor;
import rwg.util.CellNoise;
import rwg.util.NoiseGenerator;
import rwg.util.NoiseSelector;

public class ChunkGeneratorRealistic implements IChunkProvider {

Expand Down Expand Up @@ -161,11 +164,17 @@ public Chunk provideChunk(int cx, int cy) {
}

replaceBlocksForBiome(cx, cy, blocks, metadata, biomesForGeneration, baseBiomesList, noise);
caves.func_151539_a(this, worldObj, cx, cy, blocks);
if (ConfigRWG.generateCaves) {
caves.func_151539_a(this, worldObj, cx, cy, blocks);
}

mineshaftGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
if (ConfigRWG.generateMineshafts) {
mineshaftGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
}
strongholdGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
villageGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
if (ConfigRWG.generateVillages) {
villageGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
}

long second = System.currentTimeMillis();

Expand Down Expand Up @@ -452,27 +461,35 @@ public void populate(IChunkProvider ichunkprovider, int i, int j) {

MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(ichunkprovider, worldObj, rand, i, j, flag));

mineshaftGenerator.generateStructuresInChunk(worldObj, rand, i, j);
if (ConfigRWG.generateMineshafts) {
mineshaftGenerator.generateStructuresInChunk(worldObj, rand, i, j);
}
strongholdGenerator.generateStructuresInChunk(worldObj, rand, i, j);
villageGenerator.generateStructuresInChunk(worldObj, rand, i, j);
if (ConfigRWG.generateVillages) {
villageGenerator.generateStructuresInChunk(worldObj, rand, i, j);
}

boolean gen = false;

gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAKE);
if (gen && rand.nextInt(10) == 0) {
int i2 = x + rand.nextInt(16) + 8;
int l4 = rand.nextInt(50);
int i8 = y + rand.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(worldObj, rand, i2, l4, i8);
if (ConfigRWG.generateUndergroundLakes) {
gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAKE);
if (gen && rand.nextInt(10) == 0) {
int i2 = x + rand.nextInt(16) + 8;
int l4 = rand.nextInt(50);
int i8 = y + rand.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(worldObj, rand, i2, l4, i8);
}
}

gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAVA);
if (gen && rand.nextInt(18) == 0) {
int j2 = x + rand.nextInt(16) + 8;
int i5 = rand.nextInt(rand.nextInt(45) + 8);
int j8 = y + rand.nextInt(16) + 8;
if (i5 < 64 || rand.nextInt(10) == 0) {
(new WorldGenLakes(Blocks.lava)).generate(worldObj, rand, j2, i5, j8);
if (ConfigRWG.generateUndergroundLavaLakes) {
gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAVA);
if (gen && rand.nextInt(18) == 0) {
int j2 = x + rand.nextInt(16) + 8;
int i5 = rand.nextInt(rand.nextInt(45) + 8);
int j8 = y + rand.nextInt(16) + 8;
if (i5 < 64 || rand.nextInt(10) == 0) {
(new WorldGenLakes(Blocks.lava)).generate(worldObj, rand, j2, i5, j8);
}
}
}

Expand Down Expand Up @@ -746,7 +763,11 @@ public void saveExtraData() {}

public void recreateStructures(int par1, int par2) {
strongholdGenerator.func_151539_a(this, worldObj, par1, par2, (Block[]) null);
mineshaftGenerator.func_151539_a(this, worldObj, par1, par2, (Block[]) null);
villageGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[]) null);
if (ConfigRWG.generateMineshafts) {
mineshaftGenerator.func_151539_a(this, worldObj, par1, par2, (Block[]) null);
}
if (ConfigRWG.generateVillages) {
villageGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[]) null);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/rwg/world/ChunkManagerRealistic.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;

import gnu.trove.map.hash.TLongObjectHashMap;
import rwg.biomes.realistic.RealisticBiomeBase;
import rwg.support.Support;
import rwg.util.CellNoise;
import rwg.util.NoiseGenerator;
import rwg.util.NoiseSelector;
import gnu.trove.map.hash.TLongObjectHashMap;

public class ChunkManagerRealistic extends WorldChunkManager {

Expand Down

0 comments on commit dbf07ca

Please sign in to comment.