Advertisement
Camellias_

Untitled

Jun 14th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.39 KB | None | 0 0
  1. public void buildSurfaces(int p_185937_1_, int p_185937_2_, ChunkPrimer primer)
  2.     {
  3.         if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, p_185937_1_, p_185937_2_, primer, this.world)) return;
  4.         int i = this.world.getSeaLevel() + 1;
  5.         double d0 = 0.03125D;
  6.         this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_185937_1_ * 16, p_185937_2_ * 16, 0, 16, 16, 1, 0.03125D, 0.03125D, 1.0D);
  7.         this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, p_185937_1_ * 16, 109, p_185937_2_ * 16, 16, 1, 16, 0.03125D, 1.0D, 0.03125D);
  8.         this.depthBuffer = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.depthBuffer, p_185937_1_ * 16, p_185937_2_ * 16, 0, 16, 16, 1, 0.0625D, 0.0625D, 0.0625D);
  9.  
  10.         for (int j = 0; j < 16; ++j)
  11.         {
  12.             for (int k = 0; k < 16; ++k)
  13.             {
  14.                 boolean flag = this.slowsandNoise[j + k * 16] + this.rand.nextDouble() * 0.2D > 0.0D;
  15.                 boolean flag1 = this.gravelNoise[j + k * 16] + this.rand.nextDouble() * 0.2D > 0.0D;
  16.                 int l = (int)(this.depthBuffer[j + k * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
  17.                 int i1 = -1;
  18.                 IBlockState iblockstate = NETHERRACK;
  19.                 IBlockState iblockstate1 = NETHERRACK;
  20.  
  21.                 for (int j1 = 127; j1 >= 0; --j1)
  22.                 {
  23.                     if (j1 < 127 - this.rand.nextInt(5) && j1 > this.rand.nextInt(5))
  24.                     {
  25.                         IBlockState iblockstate2 = primer.getBlockState(k, j1, j);
  26.  
  27.                         if (iblockstate2.getBlock() != null && iblockstate2.getMaterial() != Material.AIR)
  28.                         {
  29.                             if (iblockstate2.getBlock() == Blocks.NETHERRACK)
  30.                             {
  31.                                 if (i1 == -1)
  32.                                 {
  33.                                     if (l <= 0)
  34.                                     {
  35.                                         iblockstate = AIR;
  36.                                         iblockstate1 = NETHERRACK;
  37.                                     }
  38.                                     else if (j1 >= i - 4 && j1 <= i + 1)
  39.                                     {
  40.                                         iblockstate = NETHERRACK;
  41.                                         iblockstate1 = NETHERRACK;
  42.  
  43.                                         if (flag1)
  44.                                         {
  45.                                             iblockstate = GRAVEL;
  46.                                             iblockstate1 = NETHERRACK;
  47.                                         }
  48.  
  49.                                         if (flag)
  50.                                         {
  51.                                             iblockstate = SOUL_SAND;
  52.                                             iblockstate1 = SOUL_SAND;
  53.                                         }
  54.                                     }
  55.  
  56.                                     if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.AIR))
  57.                                     {
  58.                                         iblockstate = LAVA;
  59.                                     }
  60.  
  61.                                     i1 = l;
  62.  
  63.                                     if (j1 >= i - 1)
  64.                                     {
  65.                                         primer.setBlockState(k, j1, j, iblockstate);
  66.                                     }
  67.                                     else
  68.                                     {
  69.                                         primer.setBlockState(k, j1, j, iblockstate1);
  70.                                     }
  71.                                 }
  72.                                 else if (i1 > 0)
  73.                                 {
  74.                                     --i1;
  75.                                     primer.setBlockState(k, j1, j, iblockstate1);
  76.                                 }
  77.                             }
  78.                         }
  79.                         else
  80.                         {
  81.                             i1 = -1;
  82.                         }
  83.                     }
  84.                     else
  85.                     {
  86.                         primer.setBlockState(k, j1, j, BEDROCK);
  87.                     }
  88.                 }
  89.             }
  90.         }
  91.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement