package Justin_Perry.learningMod.gen;
import java.util.Random;
import Justin_Perry.learningMod.init.modBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.fml.common.IWorldGenerator;
public class nestGen implements IWorldGenerator{
@Override
public void generate(Random random, int ChunkX, int ChunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.getDimension() == 0 ) {
generateSurface(random, ChunkX, ChunkZ, world, chunkGenerator, chunkProvider);
}
}
private void generateSurface(Random random, int ChunkX, int ChunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
generateOre(modBlocks.BEE_NEST_BLOCK.getDefaultState(), world, random, ChunkX*16, ChunkZ*16, 63, 80, 40, 50);
}
private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) {
int deltaY = maxY - minY;
for(int i = 0; i < chances; i++) {
BlockPos pos = new BlockPos (x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));
WorldGenMinable generator = new WorldGenMinable(ore, size);
generator.generate(world, random, pos);
}
}
}
I am attempting to generate a block, BEE_NEST_BLOCK on the surface of the overworld only. I have drastically increased the size and possibility of the block's generation just to make sure it is being generated. I discovered it is, in fact, being generated, However, my hypothesis, based on visual inspection, is that these blocks are only "replacing" stone blocks. If I could be lead in the right direction, I would appreciate it. I have spent a few hours on this situation as well as looking for a hint from previous posts, but I could not find any. Thank you very much for your time, patience, and effort to help me.