Jump to content

Generating a custom village?


zombiekiller222

Recommended Posts

I've copied all of the appropriate appropriate classes for Village, but unfortunately, I cannot even get the DEFAULT village to spawn. I understand there is a % chance, but in superflat after flying a long time I've yet to find one (with default MC structures disabled). Here is my code:

package plantony.lotrcraft;

import java.util.Random;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.MapGenVillage;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class WorldGeneratorLotrCraft implements IWorldGenerator 
{
MapGenVillage mapGenVillage = new MapGenVillage(1);
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
	switch (world.provider.dimensionId)
	{
		case -1: generateNether(world, random, chunkX*16, chunkZ*16);
		case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
	}
}


private void generateSurface(World world, Random random, int blockX, int blockZ) 
{
	//int Xcoord1 = blockX + random.nextInt(16);
	//int Ycoord1 = random.nextInt(80);
	//int Zcoord1 = blockZ + random.nextInt(16);
	mapGenVillage.generate(world.getChunkProvider(), world, blockX, blockZ, new byte[32768]);
}

private void generateNether(World world, Random random, int blockX, int blockZ) 
{
}

}

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.