Jump to content

MC 1.10 Worldgen, blocks do not generate in the nether[SOLVED]


Recommended Posts

Posted

I have Updated my Worldgen class.

For the overworld the blocks are generating, but for the nether they don't.

 

public class ModWorldGenerator implements IWorldGenerator {



@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	// TODO Auto-generated method stub
	switch(world.provider.getDimensionType())
	{
	case NETHER:
		generateNether(world, random, chunkX, chunkZ);
		break;
	case OVERWORLD:
		generateOverworld(world, random, chunkX, chunkZ);
		break;
	case THE_END:
		generateEnd(world, random, chunkX, chunkZ);
		break;
	}
}

public void generateNether(World world, Random rand, int x, int z){
	generateOre(ModBlocks.demonite.getDefaultState(), world, rand, 0, x, z, 33, 66, 75, 1, 256, Blocks.NETHERRACK);
	//generateSingleOre(TemBlocks.fel_iron_ore, world, rand, 0, x, z, 100, 1, 256, TemBlocks.demonite);

}

public void generateOverworld(World world, Random rand, int x, int z){


	int XX = x* 16;
	int ZZ = z* 16;
	BlockPos pos = new BlockPos(XX, 70, ZZ);
	String biome = world.getBiomeGenForCoords(pos).getBiomeName();//getWorldChunkManager().getBiomeGenAt(XX, ZZ);


	if(biome.contains("River")){
		generateOre(ModBlocks.chalkstone.getDefaultState(), world, rand, 0, x, z, 25, 33, 100, 45, 65, Blocks.STONE);
	}
	if(biome.contains("Ocean")){
		generateOre(ModBlocks.chalkstone.getDefaultState(), world, rand, 0, x, z, 15, 33, 50, 20, 50, Blocks.STONE);
		generateOre(ModBlocks.chalkstone.getDefaultState(), world, rand, 0, x, z, 15, 33, 50, 10, 50, Blocks.STONE);
		generateOre(ModBlocks.chalkstone.getDefaultState(), world, rand, 0, x, z, 10, 15, 50, 30, 50, Blocks.GRAVEL);
	}
	if(biome.contains("Hills") || biome.contains("Mountain")){
		generateOre(ModBlocks.marblestone.getDefaultState(), world, rand, 0, x, z, 25, 33, 50, 65, 256, Blocks.STONE);
	}

	//generateOre(TemBlocks.andesite, world, rand, 0, x, z, 25, 33, 50, 1, 250, Blocks.stone);
	//generateOre(TemBlocks.diorite, world, rand, 0, x, z, 25, 33, 50, 1, 250, Blocks.stone);
	//generateOre(TemBlocks.granite, world, rand, 0, x, z, 25, 33, 50, 1, 250, Blocks.stone);




}

public void generateEnd(World world, Random rand, int x, int z){
	//generateOre(TemBlocks.chalkstone, world, rand, 1, x, z, 2, 10, 5, 1, 100, Blocks.end_stone);

}

public void generateOre(IBlockState state, World world, Random random, int meta, int chunkX, int chunkZ, int minVienSize, 
		int maxVienSize, int chance, int minY, int maxY, Block generateIn){
	int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
	int heightRange = maxY - minY + 1;
	WorldGenMinable gen = new WorldGenMinable(state,vienSize);
	for(int i =0; i < chance; i++){
		int xRand = chunkX * 16 + random.nextInt(16);
		int yRand = random.nextInt(heightRange) + minY;
		int zRand = chunkZ * 16 + random.nextInt(16);
		//Block testblock = world.getBlock(xRand, yRand, zRand);
		BlockPos pos = new BlockPos(xRand, yRand, zRand);

		gen.generate(world,  random ,pos);


	}


}
/*	
public void generateSingleOre(Block block, World world, Random random, int meta, int chunkX, int chunkZ, 
		int chance, int minY, int maxY, Block generateIn){
	//int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
	int heightRange = maxY - minY + 1;
	WorldGenSingleMinable gen = new WorldGenSingleMinable(block, meta,  generateIn);
	for(int i =0; i < chance; i++){
		int xRand = chunkX * 16 + random.nextInt(16);
		int yRand = random.nextInt(heightRange) + minY;
		int zRand = chunkZ * 16 + random.nextInt(16);
		Block testblock = world.getBlock(xRand, yRand, zRand);
		if (testblock==generateIn){
		gen.generate(world,  random , xRand, yRand, zRand);

		}
	}



}
*/



}

 

 

Anyone has an idea why my blocks don't generate in the nether?

 

nvm i looked into the WorldGenMinable and i saw i need to use a predicate.

Solved it :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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