gt:                 for (int dz = 1; dz <= 30; dz++) {
context: package us.talabrek.ultimateskyblock.util;
  
  import dk.lockfuglsang.minecraft.po.I18nUtil;
  import org.apache.commons.lang.Validate;
  import org.bukkit.Bukkit;
  import org.bukkit.ChunkSnapshot;
  import org.bukkit.Location;
  import org.bukkit.Material;
  import org.bukkit.World;
  import org.bukkit.block.Block;
  import org.bukkit.block.BlockFace;
  import org.bukkit.block.data.BlockData;
  import org.bukkit.material.Directional;
  import org.bukkit.scheduler.BukkitRunnable;
  import org.jetbrains.annotations.NotNull;
  import us.talabrek.ultimateskyblock.Settings;
  import us.talabrek.ultimateskyblock.api.async.Callback;
  
  import java.util.Locale;
  import java.util.Optional;
  import java.util.logging.Level;
  import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  
  import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
  import static us.talabrek.ultimateskyblock.util.LogUtil.log;
  
  /**
   * Responsible for various transformations and queries of locations.
   */
  public enum LocationUtil {
      ;
      private static final Pattern LOCATION_PATTERN = Pattern.compile("((?<world>[^:]+):)?(?<x>[\\-0-9\\.]+),(?<y>[\\-0-9\\.]+),(?<z>[\\-0-9\\.]+)(:(?<yaw>[\\-0-9\\.]+):(?<pitch>[\\-0-9\\.]+))?");
      private static final String[] CARDINAL_DIRECTION = {
              I18nUtil.marktr("North"),
              I18nUtil.marktr("North-East"),
              I18nUtil.marktr("East"),
              I18nUtil.marktr("South-East"),
              I18nUtil.marktr("South"),
              I18nUtil.marktr("South-West"),
              I18nUtil.marktr("West"),
              I18nUtil.marktr("North-West")
      };
  
      public static String asString(Location loc) {
          if (loc == null) {
              return null;
          }
          String s = "";
          if (loc.getWorld() != null) {
              s += loc.getWorld().getName() + ":";
          }
          s += String.format(Locale.ENGLISH, "%.2f,%.2f,%.2f", loc.getX(), loc.getY(), loc.getZ());
          if (loc.getYaw() != 0f || loc.getPitch() != 0f) {
              s += String.format(Locale.ENGLISH, ":%.2f:%.2f", loc.getYaw(), loc.getPitch());
          }
          return s;
      }
  
      public static String asKey(Location loc) {
          return asString(loc).replaceAll(":", "-").replaceAll("\\.", "_");
      }
  
      public static Location fromString(String locString) {
          if (locString == null || locString.isEmpty()) {
              return null;
          }
          Matcher m = LOCATION_PATTERN.matcher(locString);
          if (m.matches()) {
              return new Location(Bukkit.getWorld(m.group("world")),
                      Double.parseDouble(m.group("x")),
                      Double.parseDouble(m.group("y")),
                      Double.parseDouble(m.group("z")),
                      m.group("yaw") != null ? Float.parseFloat(m.group("yaw")) : 0,
                      m.group("pitch") != null ? Float.parseFloat(m.group("pitch")) : 0
                      );
          }
          return null;
      }
  
      public static boolean isEmptyLocation(Location location) {
          return location == null || (location.getBlockX() == 0 && location.getBlockZ() == 0 && location.getBlockY() == 0);
      }
  
      public static String getIslandName(Location location) {
          if (location == null) {
              return null;
          }
          return location.getBlockX() + "," + location.getBlockZ();
      }
  
      public static Location centerOnBlock(Location loc) {
          if (loc == null) {
              return null;
          }
          return new Location(loc.getWorld(),
                  loc.getBlockX() + 0.5, loc.getBlockY() + 0.1, loc.getBlockZ() + 0.5,
                  loc.getYaw(), loc.getPitch());
      }
  
      public static Location centerInBlock(Location loc) {
          if (loc == null) {
              return null;
          }
          return new Location(loc.getWorld(),
                  loc.getBlockX() + 0.5, loc.getBlockY() + 0.5, loc.getBlockZ() + 0.5,
                  loc.getYaw(), loc.getPitch());
      }
  
      public static boolean isSafeLocation(final Location l) {
          if (l == null) {
              return false;
          }
          final Block ground = l.getBlock().getRelative(BlockFace.DOWN);
          final Block air1 = l.getBlock();
          final Block air2 = l.getBlock().getRelative(BlockFace.UP);
          return ground.getType().isSolid() && BlockUtil.isBreathable(air1) && BlockUtil.isBreathable(air2);
      }
  
      public static void loadChunkAt(Location loc) {
          if (loc != null && !loc.getWorld().isChunkLoaded(loc.getBlockX() >> 4, loc.getBlockZ() >> 4)) {
              loc.getWorld().loadChunk(loc.getBlockX() >> 4, loc.getBlockZ() >> 4);
          }
      }
  
      /**
       * Finds the nearest block to loc that is a chest.
       *
       * @param loc The location to scan for a chest.
       * @return The location of the chest
       */
      public static Location findChestLocation(final Location loc) {
          loadChunkAt(loc);
          World world = loc.getWorld();
          int px = loc.getBlockX();
          int pz = loc.getBlockZ();
          int py = loc.getBlockY();
          ChunkUtil.Chunks snapshots;
          if (px % 16 == 0 && pz % 16 == 0) {
              // chunk aligned
              snapshots = ChunkUtil.getSnapshots4x4(loc);
          } else {
              snapshots = ChunkUtil.getSnapshots(loc, 1);
          }
          for (int dy = 1; dy <= 30; dy++) {
              for (int dx = 1; dx <= 30; dx++) {
                  for (int dz = 1; dz <= 30; dz++) {
                      // Scans from the center and out
                      int x = px + (dx % 2 == 0 ? dx / 2 : -dx / 2);
                      int z = pz + (dz % 2 == 0 ? dz / 2 : -dz / 2);
                      int y = py + (dy % 2 == 0 ? dy / 2 : -dy / 2);
                      if (snapshots.getBlockTypeAt(x, y, z) == Material.CHEST) {
                          return new Location(world, x, y, z);
                      }
                  }
              }
          }
          return null;
      }
  
      public static Optional<Location> findNearestSpawnLocation(@NotNull Location loc) {
          Validate.notNull(loc.getWorld(), "World in the given Location cannot be null.");
  
          loadChunkAt(loc);
          World world = loc.getWorld();
          int px = loc.getBlockX();
          int pz = loc.getBlockZ();
          int py = loc.getBlockY();
          Block chestBlock = world.getBlockAt(loc);
          if (chestBlock.getType() == Material.CHEST) {
              BlockFace primaryDirection = null;
              // Start by checking in front of the chest.
              BlockData data = chestBlock.getBlockData();
              if (data instanceof Directional) {
                  primaryDirection = ((Directional) data).getFacing();
              }
              if (primaryDirection == BlockFace.NORTH) {
                  // Neg Z
                  pz -= 1; // start one block in the north dir.
              } else if (primaryDirection == BlockFace.SOUTH) {
                  // Pos Z
                  pz += 1; // start one block in the south dir
              } else if (primaryDirection == BlockFace.WEST) {
                  // Neg X
                  px -= 1; // start one block in the west dir
              } else if (primaryDirection == BlockFace.EAST) {
                  // Pos X
                  px += 1; // start one block in the east dir
              }
          }
          return Optional.ofNullable(findNearestSafeLocation(new Location(loc.getWorld(), px, py, pz), loc));
      }
  
      public static Location findNearestSafeLocation(Location loc, Location lookAt) {
          if (loc == null) {
              return null;
          }
          loadChunkAt(loc);
          World world = loc.getWorld();
          int px = loc.getBlockX();
          int pz = loc.getBlockZ();
          int py = loc.getBlockY();
          for (int dy = 1; dy <= 30; dy++) {
              for (int dx = 1; dx <= 30; dx++) {
  