예제 #1
0
파일: PvP.java 프로젝트: Kronosville/OneB
 public static void setPvPState(Player player, boolean state) {
   if (state) {
     player.setMetadata(PVP_META, new FixedMetadataValue(PLUGIN, true));
     player.setPlayerListName(ChatColor.RED + player.getName());
   } else {
     player.removeMetadata(PVP_META, PLUGIN);
     player.setPlayerListName(null);
   }
   OneB.sendMsg(player, "PvP " + getPvPStateString(player) + ".");
 }
예제 #2
0
파일: PvP.java 프로젝트: Kronosville/OneB
 /**
  * Tab now shows the names of players with PvP enabled in red, making this function redundant.
  *
  * @param receiver The receiver of the player list
  */
 public static void listPlayers(CommandSender receiver) {
   for (Player player : Bukkit.getServer().getOnlinePlayers()) {
     ChatColor colour;
     if (getPvPState(player)) {
       colour = ChatColor.RED;
     } else {
       colour = ChatColor.GREEN;
     }
     OneB.sendMsg(receiver, colour + player.getName());
   }
 }