示例#1
0
  private void checkCommand() {
    switch (label.toLowerCase()) {
      case "setlobby":
        LobbySetter lobbySetter = new LobbySetter(player, command, args, fileConfiguration);
        lobbySetter.setLobby();
        player.sendMessage("The Lobby was set " + ChatColor.DARK_AQUA + "successfully!");
        isCommand = true;
        break;

      case "lobby":
        onLobbyCommandIssued();
        break;

      case "l":
        onLobbyCommandIssued();
        break;

      case "spawn":
        onLobbyCommandIssued();
        break;

      case "kwlist":
        new PlayerList(player);
        break;

      case "kwreload":
        PluginLoader.getInstance().reloadConfig();
        PluginLoader.getInstance().setupApiHashMaps();
        break;

      case "kwinit":
        Thread thread = new Thread(new Initializer());
        thread.start();
        break;

      default:
        isCommand = false;
        break;
    }
  }
示例#2
0
 private void onLobbyCommandIssued() {
   player.setMetadata(
       "lobbyCommandTriggered", new FixedMetadataValue(PluginLoader.getInstance(), true));
   LobbyTeleporter lobbyTeleporter = new LobbyTeleporter(player, fileConfiguration);
   if (!lobbyTeleporter.isLobbySet()) {
     player.sendMessage(
         ChatColor.BLUE
             + "The lobby was not set yet! Set the lobby with "
             + ChatColor.DARK_RED
             + "/setlobby");
   } else {
     lobbyTeleporter.teleportToLobby();
     player.sendMessage(
         ChatColor.GREEN + ChatColor.BOLD.toString() + "-------Welcome to the Lobby-------");
   }
 }