hohserg

Untitled

Jul 3rd, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.22 KB | None | 0 0
  1. public static WorldIO<?> generateWorld =
  2.             start()
  3.                     .andThen((world, chunkX, chunkZ) ->
  4.                             when(chunkX * chunkX + chunkZ * chunkZ < centralIslandSize * centralIslandSize,
  5.                                     getChunkFromChunkCoords
  6.                                             .flatMap(chunk ->
  7.                                                     when(!chunk.isEmpty(),
  8.                                                             effect(() -> {
  9.                                                                 int startX = chunkX << 4;
  10.                                                                 int startZ = chunkZ << 4;
  11.                                                                 return generateInArea1(
  12.                                                                         new BlockPos(startX, 30, startZ),
  13.                                                                         new BlockPos(startX + 15, 50, startZ + 15),
  14.                                                                         pos ->
  15.                                                                                 whenEffect(onlyWorld(w -> w.rand.nextInt(40) == 0),
  16.                                                                                         onlyWorld(w -> logDirection(w, pos).getOpposite())
  17.                                                                                                 .flatMap(direction -> {
  18.                                                                                                     BlockLog.EnumAxis value = BlockLog.EnumAxis.fromFacingAxis(direction.getAxis());
  19.                                                                                                     return when(value != BlockLog.EnumAxis.Y && world.getBlockState(pos).getBlock() == END_STONE && aroundBlocks(world, pos, AIR, 4, new HashSet<>()),
  20.                                                                                                             effect(() -> {
  21.                                                                                                                 int lvl = 2 + world.rand.nextInt(3);
  22.                                                                                                                 for (int i = 0; i < lvl; i++)
  23.                                                                                                                     world.setBlockState(pos.offset(direction, i), enderLog.withProperty(LOG_AXIS, value), 18);
  24.  
  25.                                                                                                                 generateLeaveaAround(world, pos.offset(direction), lvl);
  26.                                                                                                             })
  27.                                                                                                     );
  28.                                                                                                 })
  29.                                                                                 )
  30.                                                                 );
  31.                                                             }).flatten()
  32.                                                     ))));
Advertisement
Add Comment
Please, Sign In to add comment