Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RubyWorldGen implements IWorldGenerator
- {
- public WorldGenerator gen_Rubyore;
- public RubyWorldGen ()
- {
- gen_Rubyore = new WorldGenMinable(RubyBlocks.Rubyore.getDefaultState(), 8);
- }
- public void runGenerator(WorldGenerator generator, World world, Random random, int chunkX, int chunkZ, int veinsPerChunk,int minHeight, int maxHeight)
- {
- if (minHeight<0 || maxHeight > 265 || minHeight > maxHeight)
- throw new IllegalArgumentException("Illegal Height");
- int heightDiff = maxHeight - minHeight + 1;
- for (int i = 0; i < veinsPerChunk; i++)
- {
- int x = chunkX * 16 + random.nextInt(16);
- int y = minHeight + random.nextInt(heightDiff);
- int z = chunkZ * 16 + random.nextInt(16);
- generator.generate(world, random, new BlockPos(x, y, z));
- }
- }
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
- {
- switch (world.provider.getDimension())
- {
- case 1:
- break;
- case 0:
- runGenerator(gen_Rubyore, world, random, chunkX, chunkZ, 15, 0, 40);
- break;
- case -1:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement