KingOfMiners Posted March 1, 2015 Posted March 1, 2015 I Can't get my ore to generate in the nether i Have the same coding as my ruby ore generation but i cant seem to get the ore to generate in the nether: package com.moreoresmod.main.worldgeneration; import java.util.Random; import com.moreoresmod.main.init.MoreOresModBlocks; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class NetherDiamondGeneration implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimensionId()){ case 1: generateEnd(world, random, chunkX, chunkZ); break; case 0: generateOverworld(world, random, chunkX, chunkZ); break; case -1: generateNether(world, random, chunkX, chunkZ); break; } } public void generateEnd(World world, Random random, int x, int z){ } public void generateOverworld(World world, Random random, int x, int z){ } public void generateNether(World world, Random random, int x, int z){ generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack); } public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance , int minY, int maxY, Block generateIn){ int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize); int hightRange = maxY - minY; WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize); for(int i = 0; i < chance; i++){ int xRand = chunkX * 16 + random.nextInt(16); int yRand = random.nextInt(hightRange) + minY; int zRand = chunkZ * 16 + random.nextInt(16); gen.generate(world, random,new BlockPos(xRand, yRand, zRand)); } } } 1
KingOfMiners Posted March 1, 2015 Author Posted March 1, 2015 i know but where exactly and how would i put it 1
KingOfMiners Posted March 1, 2015 Author Posted March 1, 2015 Will It Work Now? package com.moreoresmod.main.worldgeneration; import java.util.Random; import akka.japi.Predicate; import com.moreoresmod.main.init.MoreOresModBlocks; import net.minecraft.block.Block; import net.minecraft.block.state.pattern.BlockHelper; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class NetherDiamondGeneration implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { BlockHelper.forBlock(Blocks.netherrack); switch(world.provider.getDimensionId()){ case 1: generateEnd(world, random, chunkX, chunkZ); break; case 0: generateOverworld(world, random, chunkX, chunkZ); break; case -1: generateNether(world, random, chunkX, chunkZ); break; } } public void generateEnd(World world, Random random, int x, int z){ } public void generateOverworld(World world, Random random, int x, int z){ } public void generateNether(World world, Random random, int x, int z){ generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack); } public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance , int minY, int maxY, Block generateIn){ int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize); int hightRange = maxY - minY; WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize); for(int i = 0; i < chance; i++){ int xRand = chunkX * 16 + random.nextInt(16); int yRand = random.nextInt(hightRange) + minY; int zRand = chunkZ * 16 + random.nextInt(16); gen.generate(world, random,new BlockPos(xRand, yRand, zRand)); } } } 1
KingOfMiners Posted March 1, 2015 Author Posted March 1, 2015 i do know basic java but i sometimes have a hard time understanding somethings 1
KingOfMiners Posted March 1, 2015 Author Posted March 1, 2015 it works now but you could have said in the constructor WorldGenMinable you put BlockHelper.forBlock(Blocks.netherrack);
KingOfMiners Posted March 1, 2015 Author Posted March 1, 2015 never mind the good part is it is fixed
EOT3000 Posted September 22, 2018 Posted September 22, 2018 What would I use instead of BlockHelper.forBlock in forge 1.12.2?
Animefan8888 Posted September 22, 2018 Posted September 22, 2018 42 minutes ago, EOT3000 said: What would I use instead of BlockHelper.forBlock in forge 1.12.2? Please do not necro a thread. Make your own thread. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Recommended Posts