Example #1
0
  public static IntLocation getIntLocation(String string) {

    if (string == null) {
      MiscUtils.safeLogging("[Serverport] Unable to parse " + string + " as int location");
      return null;
    }

    String[] split = string.split(",");

    if (split.length != 4 && split.length != 3) {
      MiscUtils.safeLogging("[Serverport] Unable to parse " + string + " as int location");
      return null;
    }

    String name;
    if (split.length == 3) {
      name = ((World) MyServer.bukkitServer.getWorlds().get(0)).getName();
    } else {
      name = split[3];
    }

    return new IntLocation(
        MiscUtils.getInt(split[0]), MiscUtils.getInt(split[1]), MiscUtils.getInt(split[2]), name);
  }