some notes
world class is in net.mineraft.world
interesting parts of the world class
1. the WorldProvider provider, which provides worlds i guess
2. The IchunkProvider chunkProvider, which provides chunks i guess
3. the WorldInfo worldInfo, which contains worldinfo i guess
4. villageCollectionObj
5. the constructor method (duh)
6. the getBiomeProvider method. it's unclear how biome generation and world/chunk gen is tied together
7. getSeed (probably will be useful later...)
some notes i found on worldgen:
http://www.minecraftforge.net/forum/topic/40443-1102-world-generation/----
so it looks like the world generator contains both the chunk generator and the biome provider
also, the chunk generator is responsible for the structures
i found an implementation of the chunk generator abstract class in ChunkGeneratorOverworld.java
---
searching in another part of the code (EntitySlime.java) revealed this nugget in the getCanSpawnHere function
if (this.world.getDifficulty() != EnumDifficulty.PEACEFUL)
{
Biome biome = this.world.getBiome(blockpos);
if (biome == Biomes.SWAMPLAND && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.world.getCurrentMoonPhaseFactor() && this.world.getLightFromNeighbors(new BlockPos(this)) <= this.rand.nextInt(8))
{
return super.getCanSpawnHere();
}
if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D)
{
return super.getCanSpawnHere();
}
}
return false;
for reference, here's getRandomWithSeed:
public Random getRandomWithSeed(long seed)
{
return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ seed);
}
for reference, the nextInt function is equivalent to mod
so basically, this very light reading of the source-code is already sufficient for me to locate the seed, if i knew the locations of a few slime chunks (say 20 or so)