SHARE
TWEET

classe commands

a guest Nov 19th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(cmd.getName().equalsIgnoreCase("moneytop")) {
  2.             String configTag = plugin.config.getString("messages.prefix").replaceAll("&", "§") + " ";
  3.             if(sender instanceof Player) {
  4.                 if(!(sender.isOp() || sender.hasPermission("ark.economy.admin") || sender.hasPermission("ark.economy.top"))) {
  5.                     String message = plugin.getConfig().getString("messages.noPermission")
  6.                             .replaceAll("&", "§");
  7.                     sender.sendMessage(configTag + message);
  8.                 }
  9.             }
  10.            
  11.             String message = plugin.config.getString("messages.topMoneyHeader").replaceAll("&", "§") + "\n";
  12.             String template = plugin.config.getString("messages.topMoneyLine").replaceAll("&", "§") + "\n";
  13.             int count = 0;
  14.            
  15.             Map<Double, String> players = new TreeMap<Double, String>(Collections.reverseOrder());
  16.             players = plugin.getMoneyTop();
  17.            
  18.             Set<Double> chaves = players.keySet();
  19.             for (Double chave : chaves)
  20.             {
  21.                 if(chave != null)
  22.                     count++;
  23.                     message += template
  24.                             .replaceAll("@count", ""+count)
  25.                             .replaceAll("@player", ""+players.get(chave))
  26.                             .replaceAll("@money", ""+chave);
  27.             }
  28.             players.clear();
  29.             sender.sendMessage(configTag+message);
  30.         }
  31.         return false;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top