Alexander0507 Posted March 8, 2014 Share Posted March 8, 2014 I had working worldgen for my ore in 1.6 but I can't find my ore now in 1.7. WorldGenClass: package Lord_of_Block.worldgen; import java.util.Random; import Lord_of_Block.blocks.blocks; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; public class NividiumGen implements IWorldGenerator { public WorldGenerator myCustomOre; public NividiumGen() { GameRegistry.registerWorldGenerator(this, 0); myCustomOre = new WorldGenMinable(blocks.ore, 2048, 7, Blocks.stone); // 2048 = Block Id, 7 = Maximum number of ores per cluster } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { generateOre(random, chunkX, chunkZ, world, 8, myCustomOre, 0, 63); // 8 = Number of clusters it tries to generate per chunk } private void generateOre(Random rand, int chunkX, int chunkZ, World world, int iterations, WorldGenerator gen, int lowestY, int highestY) { for (int i = 0; i < iterations; i++) { int x = chunkX * 16; int y = rand.nextInt(highestY - lowestY) + lowestY; int z = chunkZ * 16; gen.generate(world, rand, x, y, z); } } } Quote Link to comment Share on other sites More sharing options...
PeterRDevries Posted March 8, 2014 Share Posted March 8, 2014 GameRegistry.registerWorldGenerator(this, 0); chage to GameRegistry.registerWorldGenerator(this, 1); Worked for me atleast. Quote I'm always happy to help others! Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL Link to comment Share on other sites More sharing options...
sequituri Posted March 8, 2014 Share Posted March 8, 2014 The argument as the generator is only used for sorting the generator. The problem with your code is not that. My mod uses 1000 as in GameRegistry.registerWorldGenerator(new MetalOreGen(), 1000); And my ores generator everywhere. I'd suggest actually checking what the generator is doing. Look closely at your WorldGenMinable constructor call. The called constructor seems to take arguments that disagree with what you are sending. Minecraft code: public WorldGenMinable(Block block, int meta, int number, Block target) { this(block, number, target); this.mineableBlockMeta = meta; } You are sending "WorldGenMinable(blocks.ore, 2048, 7, Blocks.stone)". I don't think 2048 is a good meta. Quote -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img] 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.