Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArrayList<String> getBaltop(){
- //DecimalFormat df = new DecimalFormat("###,###.##");
- Map<String, Object> map = money.getConfig().getConfigurationSection("Balances").getValues(true);
- ArrayList<String> lines = new ArrayList<String>();
- for(Entry<String, Object> e : map.entrySet()) {
- lines.add(e.getValue() + " " + e.getKey());
- }
- return lines;
- }
- if(cl.equalsIgnoreCase("baltop")) {
- s.sendMessage(prefix + "Balance tops are");
- ArrayList<String> data = getBaltop();
- Collections.sort(data, new Comparator<String>() {
- @Override
- public int compare(String a, String b) {
- double aVal = Double.parseDouble(a.split(" ")[0]);
- double bVal = Double.parseDouble(b.split(" ")[0]);
- return Double.compare(aVal, bVal);
- }
- });
- for(int i = (data.size() > 10 ? 10 : data.size()) - 1; i >= 0; i--) {
- String line = data.get(i);
- String[] splitter = line.split(" ");
- String pname = splitter[1]; String bal = splitter[0];
- s.sendMessage("§c§l" + pname + "§6§l: §a§l$§e§l" + bal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement