Posted May 24, 20169 yr Hey Forge Community, My Problem is, that the second Parameter of the registerWorldGenerator method is "modGenerationWeight", so my problem is, I implemented more than 1 ore, but only one spawning, when I test the Mod. I know (through testing) that its affected by the "modGenerationWeight", but in every Test, only 1 is spawning. So how can I get every ore spawning? sry for my bad english
May 24, 20169 yr Author Hey Forge Community, My Problem is, that the second Parameter of the registerWorldGenerator method is "modGenerationWeight", so my problem is, I implemented more than 1 ore, but only one spawning, when I test the Mod. I know (through testing) that its affected by the "modGenerationWeight", but in every Test, only 1 is spawning. So how can I get every ore spawning? sry for my bad english
May 24, 20169 yr Author I mean with "only 1 ore is spawning", I have implemented 10 new Ores (PlatinumOre, SilverOre,....), but only 1 (for example: PlatinumOre) is Spawning
May 24, 20169 yr Author I mean with "only 1 ore is spawning", I have implemented 10 new Ores (PlatinumOre, SilverOre,....), but only 1 (for example: PlatinumOre) is Spawning
May 24, 20169 yr Author Here is a part of the FMLInitializationEvent: (sry: erz=ore in english) GameRegistry.registerWorldGenerator(new BlockGenerator(eiserz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(endererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(erdeerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(feuererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(lufterz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(magieerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(naturerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(nethererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(untergrunderz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(wassererz.getDefaultState(), 15, 500), 6);
May 24, 20169 yr Author Here is a part of the FMLInitializationEvent: (sry: erz=ore in english) GameRegistry.registerWorldGenerator(new BlockGenerator(eiserz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(endererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(erdeerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(feuererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(lufterz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(magieerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(naturerz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(nethererz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(untergrunderz.getDefaultState(), 15, 500), 6); GameRegistry.registerWorldGenerator(new BlockGenerator(wassererz.getDefaultState(), 15, 500), 6);
May 24, 20169 yr Author package generation; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class BlockGenerator extends WorldGenMinable implements IWorldGenerator{ private int frequency; public BlockGenerator(IBlockState state, int blockCount, int frequency) { super(state, blockCount); this.frequency = frequency; } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { for(int i = 0; i < frequency; i++) { int offsetX = random.nextInt(16); int offsetZ = random.nextInt(16); int posX = chunkX * 16 + offsetX; int posZ = chunkZ * 16 + offsetZ; int posY = random.nextInt(50); generate(world, random, new BlockPos(posX, posY, posZ)); } } }
May 24, 20169 yr Author package generation; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class BlockGenerator extends WorldGenMinable implements IWorldGenerator{ private int frequency; public BlockGenerator(IBlockState state, int blockCount, int frequency) { super(state, blockCount); this.frequency = frequency; } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { for(int i = 0; i < frequency; i++) { int offsetX = random.nextInt(16); int offsetZ = random.nextInt(16); int posX = chunkX * 16 + offsetX; int posZ = chunkZ * 16 + offsetZ; int posY = random.nextInt(50); generate(world, random, new BlockPos(posX, posY, posZ)); } } }
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.