Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static WorldIO<?> generateWorld =
- start()
- .andThen((world, chunkX, chunkZ) ->
- when(chunkX * chunkX + chunkZ * chunkZ < centralIslandSize * centralIslandSize,
- getChunkFromChunkCoords
- .flatMap(chunk ->
- when(!chunk.isEmpty(),
- effect(() -> {
- int startX = chunkX << 4;
- int startZ = chunkZ << 4;
- return generateInArea1(
- new BlockPos(startX, 30, startZ),
- new BlockPos(startX + 15, 50, startZ + 15),
- pos ->
- whenEffect(onlyWorld(w -> w.rand.nextInt(40) == 0),
- onlyWorld(w -> logDirection(w, pos).getOpposite())
- .flatMap(direction -> {
- BlockLog.EnumAxis value = BlockLog.EnumAxis.fromFacingAxis(direction.getAxis());
- return when(value != BlockLog.EnumAxis.Y && world.getBlockState(pos).getBlock() == END_STONE && aroundBlocks(world, pos, AIR, 4, new HashSet<>()),
- effect(() -> {
- int lvl = 2 + world.rand.nextInt(3);
- for (int i = 0; i < lvl; i++)
- world.setBlockState(pos.offset(direction, i), enderLog.withProperty(LOG_AXIS, value), 18);
- generateLeaveaAround(world, pos.offset(direction), lvl);
- })
- );
- })
- )
- );
- }).flatten()
- ))));
Advertisement
Add Comment
Please, Sign In to add comment