Fix world generation.

remove-fringelands
mckuhei 2 years ago
parent 67c5a63279
commit d38af25748

@ -2,6 +2,7 @@ package net.minecraft.src;
import org.mcmodule.math.BigInteger;
import java.util.Random;
import java.util.Stack;
public class BiomeDecorator
{
@ -131,6 +132,8 @@ public class BiomeDecorator
/** True if decorator should generate surface lava & water */
public boolean generateLakes;
private Stack<DecorateInfo> stack = new Stack<>();
public BiomeDecorator(BiomeGenBase par1BiomeGenBase)
{
this.sandGen = new WorldGenSand(7, Block.sand.blockID);
@ -172,20 +175,23 @@ public class BiomeDecorator
*/
public void decorate(World par1World, Random par2Random, BigInteger par3, BigInteger par4)
{
if (this.currentWorld != null)
{
throw new RuntimeException("Already decorating!!");
}
else
{
this.currentWorld = par1World;
this.randomGenerator = par2Random;
this.chunk_X = par3;
this.chunk_Z = par4;
this.decorate();
this.currentWorld = null;
this.randomGenerator = null;
}
DecorateInfo info = new DecorateInfo();
info.world = currentWorld;
info.rand = randomGenerator;
info.chunkX = chunk_X;
info.chunkZ = chunk_Z;
stack.push(info);
this.currentWorld = par1World;
this.randomGenerator = par2Random;
this.chunk_X = par3;
this.chunk_Z = par4;
this.decorate();
info = stack.pop();
this.currentWorld = info.world;
this.randomGenerator = info.rand;
this.chunk_X = info.chunkX;
this.chunk_Z = info.chunkZ;
}
/**
@ -422,4 +428,10 @@ public class BiomeDecorator
this.genStandardOre1(1, this.diamondGen, 0, 16);
this.genStandardOre2(1, this.lapisGen, 16, 16);
}
static class DecorateInfo {
BigInteger chunkX, chunkZ;
World world;
Random rand;
}
}

@ -224,6 +224,7 @@ public class Chunk
*/
public void generateSkylightMap()
{
generateHeightMap();
// TODO
// int var1 = this.getTopFilledSegment();
// int var2;

@ -521,7 +521,7 @@ public class ChunkProviderGenerate implements IChunkProvider
}
}
// FIXME: java.lang.RuntimeException: Already decorating!!
// var6.decorate(this.worldObj, this.rand, var4, var5);
var6.decorate(this.worldObj, this.rand, var4, var5);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4.add(BigInteger.valueOf(8)), var5.add(BigInteger.valueOf(8)), 16, 16, this.rand);
var4 = var4.add(BigInteger.valueOf(8));
var5 = var5.add(BigInteger.valueOf(8));

@ -118,6 +118,7 @@ public abstract class GenLayer
*/
public void initChunkSeed(long par1, long par3)
{
// System.out.printf("X; %d Z: %d\n", par1, par3);
this.chunkSeed = this.worldGenSeed;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += par1;

@ -171,7 +171,7 @@ public class ItemInWorldManager
public void uncheckedTryHarvestBlock(BigInteger par1, int par2, BigInteger par3)
{
if (par1 == this.partiallyDestroyedBlockX && par2 == this.partiallyDestroyedBlockY && par3 == this.partiallyDestroyedBlockZ)
if (par1.equals(this.partiallyDestroyedBlockX) && par2 == this.partiallyDestroyedBlockY && par3.equals(this.partiallyDestroyedBlockZ))
{
int var4 = this.field_73100_i - this.field_73089_e;
int var5 = this.theWorld.getBlockId(par1, par2, par3);

@ -217,7 +217,7 @@ public class PlayerControllerMP
}
else
{
if (par1 == this.currentBlockX && par2 == this.currentBlockY && par3 == this.currentblockZ)
if (par1.equals(this.currentBlockX) && par2 == this.currentBlockY && par3.equals(this.currentblockZ))
{
int var5 = this.mc.theWorld.getBlockId(par1, par2, par3);

@ -316,7 +316,7 @@ public abstract class World implements IBlockAccess
*/
public Chunk getChunkFromBlockCoords(BigInteger par1, BigInteger par2)
{
return this.getChunkFromChunkCoords(par1.shiftRight(4), par1.shiftRight(4));
return this.getChunkFromChunkCoords(par1.shiftRight(4), par2.shiftRight(4));
}
/**

Loading…
Cancel
Save