Vemahk20 Posted May 3, 2013 Share Posted May 3, 2013 Simply that ^^^. Ill paste my generation code here... package IndustrialBreakout.world; import java.util.Random; import IndustrialBreakout.mod_IndustrialBreakout; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGeneratorIB implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { for(int i=10;i<=32;i++){ world.setBlock(chunkX*16 + random.nextInt(16), i, chunkZ*16 + random.nextInt(16), mod_IndustrialBreakout.oreTitanium.blockID); } for(int i = 32; i <= 64; i++){ world.setBlock(chunkX*16 + random.nextInt(16), i, chunkZ*16 + random.nextInt(16), mod_IndustrialBreakout.oreCopper.blockID); } for(int i = 10; i <= 32; i++){ world.setBlock(chunkX*16 + random.nextInt(16), i, chunkZ*16 + random.nextInt(16), mod_IndustrialBreakout.oreTin.blockID); } for(int i = 5; i <= 16; i++){ world.setBlock(chunkX*16 + random.nextInt(16), i, chunkZ*16 + random.nextInt(16), mod_IndustrialBreakout.oreChargedCoal.blockID); } } } Quote Link to comment Share on other sites More sharing options...
shadowmage4513 Posted May 3, 2013 Share Posted May 3, 2013 Quite simply, you are not checking to see if it is a valid gen-replaceable block before generating your ores. You need to check if the block going to be replaced is world-gen replaceable / stone int x = chunkX*16 +random.nextInt(16); int y = chunkY*16 +random.nextInt(16); int z = chunkZ*16 +random.nextInt(16); int id = world.getBlockID(x,y,z); Block block = Block.blocksList[id]; if(block!=null && block.isGenMineableReplaceable(world, x, y, z, Block.stone.blockID)) { //set your blocks here.... } Quote Link to comment Share on other sites More sharing options...
Vemahk20 Posted May 6, 2013 Author Share Posted May 6, 2013 Quite simply, you are not checking to see if it is a valid gen-replaceable block before generating your ores. You need to check if the block going to be replaced is world-gen replaceable / stone int x = chunkX*16 +random.nextInt(16); int y = chunkY*16 +random.nextInt(16); int z = chunkZ*16 +random.nextInt(16); int id = world.getBlockID(x,y,z); Block block = Block.blocksList[id]; if(block!=null && block.isGenMineableReplaceable(world, x, y, z, Block.stone.blockID)) { //set your blocks here.... } Thanks, it works great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.