C’est bon, j’ai régler mon problème :
public class OreGeneration implements IWorldGenerator
{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator generator, IChunkProvider provider)
{
switch (world.provider.getDimension())
{
case 1:
runGenerator(ModBlocks.RUBY_ORE, Blocks.END_STONE, 8, 200, 0, 256, random, chunkX, chunkZ, world);
break;
}
}
private void runGenerator(Block block, Block blockIn, int maxSize, int chance, int minHeight, int maxHeight, Random random, int chunkX, int chunkZ, World world)
{
if (minHeight > maxHeight || minHeight < 0 || minHeight > 256)
throw new IllegalArgumentException("Ore Generated out of bounds");
int heightDiff = maxHeight - minHeight + 1;
for (int i = 0; i < chance; i++)
{
int x = chunkX * 16 + random.nextInt(16);
int y = minHeight + random.nextInt(heightDiff);
int z = chunkZ * 16 + random.nextInt(16);
WorldGenerator generator = new WorldGenMinable(block.getDefaultState(), maxSize, BlockMatcher.forBlock(blockIn));
generator.generate(world, random, new BlockPos(x, y, z));
}
}
}