Skip to content

Commit

Permalink
Removed log spam caused by "Enabled Debugging" being stuck to true
Browse files Browse the repository at this point in the history
  • Loading branch information
whichonespink44 committed Sep 27, 2015
1 parent 7039f04 commit 8e76668
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 23 deletions.
4 changes: 3 additions & 1 deletion src/main/java/rtg/world/biome/WorldChunkManagerRTG.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ else if(wetEnabled)

if (currentBaseBiome.compareTo(previousBaseBiome) != 0 || currentRiverBiome.compareTo(previousRiverBiome) != 0)
{
FMLLog.log(Level.INFO, "Base Biome = %s; River Biome = %s", currentBaseBiome, currentRiverBiome);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "Base Biome = %s; River Biome = %s", currentBaseBiome, currentRiverBiome);
}

previousBaseBiome = currentBaseBiome;
previousRiverBiome = currentRiverBiome;
Expand Down
88 changes: 66 additions & 22 deletions src/main/java/rtg/world/gen/ChunkProviderRTG.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public class ChunkProviderRTG implements IChunkProvider

public ChunkProviderRTG(World world, long l)
{
FMLLog.log(Level.INFO, "START ChunkGeneratorRealistic (Seed=%s)", world.getSeed());
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START ChunkGeneratorRealistic (Seed=%s)", world.getSeed());
}

caves = TerrainGen.getModdedMapGen(new MapGenCaves(), CAVE);
worldObj = world;
Expand All @@ -128,7 +130,9 @@ public ChunkProviderRTG(World world, long l)
m.put("size", "0");
m.put("distance", "24");

FMLLog.log(Level.INFO, "START structure generation 1");
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START structure generation 1");
}

villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(new MapGenVillage(m), VILLAGE);
strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(new MapGenStronghold(), STRONGHOLD);
Expand Down Expand Up @@ -163,7 +167,9 @@ public ChunkProviderRTG(World world, long l)

public Chunk provideChunk(int cx, int cy)
{
FMLLog.log(Level.INFO, "START provideChunk (cx=%d, cy=%d)", cx, cy);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START provideChunk (cx=%d, cy=%d)", cx, cy);
}

rand.setSeed((long)cx * 0x4f9939f508L + (long)cy * 0x1ef1565bd5L);
Block[] blocks = new Block[65536];
Expand All @@ -172,7 +178,9 @@ public Chunk provideChunk(int cx, int cy)
biomesForGeneration = new RealisticBiomeBase[256];
int k;

FMLLog.log(Level.INFO, "START generateTerrain");
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START generateTerrain");
}

generateTerrain(cmr, cx, cy, blocks, metadata, biomesForGeneration, noise);

Expand All @@ -188,7 +196,9 @@ public Chunk provideChunk(int cx, int cy)

replaceBlocksForBiome(cx, cy, blocks, metadata, biomesForGeneration, baseBiomesList, noise);

FMLLog.log(Level.INFO, "START structure generation 2 (cx=%d, cy=%d)", cx, cy);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START structure generation 2 (cx=%d, cy=%d)", cx, cy);
}

caves.func_151539_a(this, worldObj, cx, cy, blocks);
mineshaftGenerator.func_151539_a(this, this.worldObj, cx, cy, blocks);
Expand All @@ -211,7 +221,9 @@ public Chunk provideChunk(int cx, int cy)

public void generateTerrain(WorldChunkManagerRTG cmr, int cx, int cy, Block[] blocks, byte[] metadata, RealisticBiomeBase biomes[], float[] n)
{
FMLLog.log(Level.INFO, "START generateTerrain (cx=%d, cy=%d)", cx, cy);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START generateTerrain (cx=%d, cy=%d)", cx, cy);
}

int p, h;
float[] noise = getNewNoise(cmr, cx * 16, cy * 16, biomes);
Expand Down Expand Up @@ -247,7 +259,9 @@ public void generateTerrain(WorldChunkManagerRTG cmr, int cx, int cy, Block[] bl

public float[] getNewNoise(WorldChunkManagerRTG cmr, int x, int y, RealisticBiomeBase biomes[])
{
FMLLog.log(Level.INFO, "START getNewNoise (x=%d, y=%d)", x, y);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START getNewNoise (x=%d, y=%d)", x, y);
}

int i, j, k, l, m, n, p;

Expand Down Expand Up @@ -461,7 +475,9 @@ public float[] mix4(float[][] ingredients)

public void replaceBlocksForBiome(int cx, int cy, Block[] blocks, byte[] metadata, RealisticBiomeBase[] biomes, BiomeGenBase[] base, float[] n)
{
FMLLog.log(Level.INFO, "START replaceBlocksForBiome (cx=%d, cy=%d)", cx, cy);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START replaceBlocksForBiome (cx=%d, cy=%d)", cx, cy);
}

ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, cx, cy, blocks, metadata, base, worldObj);
MinecraftForge.EVENT_BUS.post(event);
Expand Down Expand Up @@ -496,7 +512,9 @@ public void replaceBlocksForBiome(int cx, int cy, Block[] blocks, byte[] metadat

public Chunk loadChunk(int par1, int par2)
{
FMLLog.log(Level.INFO, "START loadChunk (par1=%d, par2=%d)", par1, par2);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START loadChunk (par1=%d, par2=%d)", par1, par2);
}

return provideChunk(par1, par2);
}
Expand All @@ -513,7 +531,9 @@ public boolean chunkExists(int par1, int par2)

public void populate(IChunkProvider ichunkprovider, int i, int j)
{
FMLLog.log(Level.INFO, "START populate (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START populate (i=%d, j=%d)", i, j);
}

BlockFalling.fallInstantly = true;
worldObj.scheduledUpdatesAreImmediate = true;
Expand All @@ -528,7 +548,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)

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

FMLLog.log(Level.INFO, "START structure generation 3 (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START structure generation 3 (i=%d, j=%d)", i, j);
}

mineshaftGenerator.generateStructuresInChunk(worldObj, rand, i, j);
strongholdGenerator.generateStructuresInChunk(worldObj, rand, i, j);
Expand All @@ -540,7 +562,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAKE);
if(gen && rand.nextInt(10) == 0)
{
FMLLog.log(Level.INFO, "START lake generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START lake generation (i=%d, j=%d)", i, j);
}

int i2 = x + rand.nextInt(16) + 8;
int l4 = rand.nextInt(50);
Expand All @@ -551,7 +575,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.LAVA);
if(gen && rand.nextInt(18) == 0)
{
FMLLog.log(Level.INFO, "START lava generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START lava generation (i=%d, j=%d)", i, j);
}

int j2 = x + rand.nextInt(16) + 8;
int i5 = rand.nextInt(rand.nextInt(45) + 8);
Expand All @@ -562,7 +588,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
}
}

FMLLog.log(Level.INFO, "START dungeon generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START dungeon generation (i=%d, j=%d)", i, j);
}

gen = TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.DUNGEON);
for(int k1 = 0; k1 < 8 && gen; k1++)
Expand All @@ -573,7 +601,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
(new WorldGenDungeons()).generate(worldObj, rand, j5, k8, j11);
}

FMLLog.log(Level.INFO, "START ore generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START ore generation (i=%d, j=%d)", i, j);
}

MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(worldObj, rand, x, y));

Expand Down Expand Up @@ -693,7 +723,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)

if(rand.nextInt(5) == 0)
{
FMLLog.log(Level.INFO, "START shroom generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START shroom generation (i=%d, j=%d)", i, j);
}

int k15 = x + rand.nextInt(16) + 8;
int k17 = rand.nextInt(64);
Expand All @@ -719,7 +751,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)

MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, x, y));

FMLLog.log(Level.INFO, "START lazy decorations (x=%d, y=%d)", x, y);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START lazy decorations (x=%d, y=%d)", x, y);
}

//lazy fix
TerrainGen.decorate(worldObj, rand, x, y, DecorateBiomeEvent.Decorate.EventType.SAND);
Expand Down Expand Up @@ -766,7 +800,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)

MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, x, y));

FMLLog.log(Level.INFO, "START flowing water (x=%d, y=%d)", x, y);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START flowing water (x=%d, y=%d)", x, y);
}

for(int l18 = 0; l18 < 50; l18++)
{
Expand All @@ -776,7 +812,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
(new WorldGenLiquids(Blocks.flowing_water)).generate(worldObj, rand, l21, k23, l24);
}

FMLLog.log(Level.INFO, "START flowing lava (x=%d, y=%d)", x, y);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START flowing lava (x=%d, y=%d)", x, y);
}

for(int i19 = 0; i19 < 20; i19++)
{
Expand All @@ -788,7 +826,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)

if (TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.ANIMALS))
{
FMLLog.log(Level.INFO, "START animal spawning (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START animal spawning (i=%d, j=%d)", i, j);
}

SpawnerAnimals.performWorldGenSpawning(this.worldObj, worldObj.getBiomeGenForCoords(x + 16, y + 16), x + 8, y + 8, 16, 16, this.rand);
}
Expand All @@ -798,7 +838,9 @@ public void populate(IChunkProvider ichunkprovider, int i, int j)
TerrainGen.populate(this, worldObj, rand, i, j, flag, PopulateChunkEvent.Populate.EventType.ICE);
if(snow < 0.59f)
{
FMLLog.log(Level.INFO, "START ice generation (i=%d, j=%d)", i, j);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START ice generation (i=%d, j=%d)", i, j);
}

x += 8;
y += 8;
Expand Down Expand Up @@ -899,7 +941,9 @@ public void saveExtraData() {}

public void recreateStructures(int par1, int par2)
{
FMLLog.log(Level.INFO, "START recreateStructures (par1=%d, par2=%d)", par1, par2);
if (ConfigRTG.enableDebugging) {
FMLLog.log(Level.INFO, "START recreateStructures (par1=%d, par2=%d)", par1, par2);
}

strongholdGenerator.func_151539_a(this, worldObj, par1, par2, (Block[])null);
mineshaftGenerator.func_151539_a(this, worldObj, par1, par2, (Block[])null);
Expand Down

0 comments on commit 8e76668

Please sign in to comment.