Guest User

Untitled

a guest
Apr 26th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. public class NewYorkChunkGenerator extends ChunkGenerator<NewYorkChunkGenerator.Config>
  2. {
  3.     public NewYorkChunkGenerator(IWorld world, BiomeProvider provider)
  4.     {
  5.         super(world, provider, Config.createDefault());
  6.     }
  7.  
  8.     @Override
  9.     public void generateSurface(WorldGenRegion region, IChunk chunk)
  10.     {
  11.         BlockState bedrock = Blocks.BEDROCK.getDefaultState();
  12.         BlockState pavement = SetupBlocks.PAVEMENT.get().getDefaultState();
  13.         BlockPos.Mutable pos = new BlockPos.Mutable();
  14.  
  15.         int x;
  16.         int z;
  17.  
  18.         for(x = 0; x < 16; x++)
  19.         {
  20.             for(z = 0; z < 16; z++)
  21.             {
  22.                 chunk.setBlockState(pos.setPos(x, 0, z), bedrock, false);
  23.             }
  24.         }
  25.  
  26.         for(x = 0; x < 16; x++)
  27.         {
  28.             for(z = 0; z < 16; z++)
  29.             {
  30.                 for(int y = 1; y < getGroundHeight(); y++)
  31.                 {
  32.                     chunk.setBlockState(pos.setPos(x, y, z), pavement, false);
  33.                 }
  34.             }
  35.         }
  36.     }
  37.  
  38.     @Override
  39.     public void makeBase(IWorld world, IChunk chunk) {}
  40.  
  41.     @Override
  42.     public int getGroundHeight()
  43.     {
  44.         return 128;
  45.     }
  46.  
  47.     @Override
  48.     public int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type heightmapType)
  49.     {
  50.         return 0;
  51.     }
  52.  
  53.     public static class Config extends GenerationSettings
  54.     {
  55.         public static Config createDefault()
  56.         {
  57.             Config config = new Config();
  58.             config.setDefaultBlock(SetupBlocks.PAVEMENT.get().getDefaultState());
  59.             config.setDefaultFluid(Blocks.WATER.getDefaultState());
  60.             return config;
  61.         }
  62.     }
  63. }
Add Comment
Please, Sign In to add comment