Beispiel #1
0
  public void warpToSpawn() {
    if (localSender.isConsole()) {
      localSender.notifyConsoleNotSupported();
      return;
    }

    if (!localSender.hasExternalPermissions(Perms.WARP.toString())) {
      localSender.notifyInsufPermissions();
      return;
    }

    Town t = localSender.getActiveTown();

    if (t == null) {
      localSender.notifyActiveTownNotSet();
      return;
    }

    Location spawn = t.getTownSpawn();
    if (spawn == null) {
      localSender.sendMessage(ERR + "Town spawn not set.");
      return;
    }

    localSender.getPlayer().teleport(spawn);
    localSender.sendMessage(
        ChatColor.DARK_GRAY + "Teleported to " + t.getTownName() + "! Welcome!");
  }
Beispiel #2
0
  public void warpToOtherSpawn(String townName) {
    if (localSender.isConsole()) {
      localSender.notifyConsoleNotSupported();
      return;
    }

    if (!localSender.hasExternalPermissions(Perms.WARP_FOREIGN.toString())) {
      localSender.notifyInsufPermissions();
      return;
    }

    Town t = townManager.getTown(townName);

    if (t == null) {
      localSender.sendMessage(ERR + "That town doesn't exist.");
      return;
    }

    localSender.getPlayer().teleport(t.getTownSpawn());

    localSender.sendMessage(INFO + "Teleported to " + t.getTownName() + "! Welcome!");
  }