Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ModWorldGen implements IWorldGenerator {
- @Override
- public void generate(Random random, int chunkx, int chunkz, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
- if(world.provider.getDimension() == 0) {
- generateOverworld(random, chunkx, chunkz, world, chunkGenerator, chunkProvider);
- }
- }
- private void generateOverworld(Random random, int chunkx, int chunkz, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider){
- generateOre(ModBlocks.RUBY_ORE.getDefaultState(), world, random, chunkx * 16, chunkz * 16, 16, 64, random.nextInt(7) + 4, 30);
- }
- 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);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement