Browse Source

Dont loop infinitely on Biome Gen Fail

master
Robotia 9 years ago
parent
commit
fe5714f53b
  1. 37
      patches/net/minecraft/world/biome/BiomeDecorator.java.patch

37
patches/net/minecraft/world/biome/BiomeDecorator.java.patch

@ -23,22 +23,25 @@
private static final String __OBFID = "CL_00000164"; private static final String __OBFID = "CL_00000164";
public BiomeDecorator() public BiomeDecorator()
@@ -94,7 +103,13 @@ @@ -94,7 +103,16 @@
{ {
if (this.currentWorld != null) if (this.currentWorld != null)
{ {
- throw new RuntimeException("Already decorating!!"); - throw new RuntimeException("Already decorating!!");
+ //throw new RuntimeException("Already decorating!!"); + //throw new RuntimeException("Already decorating!!");
+ System.out.println("[KC-Unofficial] Already Decorating a Chunk! Waiting..."); + System.out.println("[KC-Unofficial] Already Decorating a Chunk! Waiting...");
+ while(this.currentWorld != null) + for(int i = 0; i < 10; i++)
+ { + {
+ Thread.sleep(100L); + try{ Thread.sleep(100L); } catch(Exception e){}
+ } + }
+ decorateChunk(p_150512_1_, p_150512_2_, p_150512_3_, p_150512_4_, p_150512_5_); + if(this.currentWorld != null)
+ decorateChunk(p_150512_1_, p_150512_2_, p_150512_3_, p_150512_4_, p_150512_5_);
+ else
+ System.out.println("[KC-Unofficial] Decoration failure @ X:" + (p_150512_4_ << 4) + ", Z:" + (p_150512_5_ << 4) );
} }
else else
{ {
@@ -194,7 +209,7 @@ @@ -194,7 +212,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -47,7 +50,7 @@
WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator); WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator);
worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -204,7 +219,7 @@ @@ -204,7 +222,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -56,7 +59,7 @@
(new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l); (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -214,7 +229,7 @@ @@ -214,7 +232,7 @@
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -65,7 +68,7 @@
{ {
; ;
} }
@@ -229,7 +244,7 @@ @@ -229,7 +247,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -74,7 +77,7 @@
this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -237,7 +252,7 @@ @@ -237,7 +255,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -83,7 +86,7 @@
this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
} }
@@ -246,7 +261,7 @@ @@ -246,7 +264,7 @@
{ {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -92,7 +95,7 @@
this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
} }
@@ -254,7 +269,7 @@ @@ -254,7 +272,7 @@
{ {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -101,7 +104,7 @@
this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
} }
@@ -263,7 +278,7 @@ @@ -263,7 +281,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -110,7 +113,7 @@
this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -271,7 +286,7 @@ @@ -271,7 +289,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -119,7 +122,7 @@
this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -280,7 +295,7 @@ @@ -280,7 +298,7 @@
{ {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -128,7 +131,7 @@
(new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k); (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k);
} }
@@ -289,7 +304,7 @@ @@ -289,7 +307,7 @@
{ {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
@ -137,7 +140,7 @@
this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
} }
@@ -313,6 +328,7 @@ @@ -313,6 +331,7 @@
} }
} }
@ -145,7 +148,7 @@
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
} }
@@ -360,9 +376,34 @@ @@ -360,9 +379,34 @@
MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
} }

Loading…
Cancel
Save