mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
/bending display [element] is in alphabetical order
This commit is contained in:
parent
290696879d
commit
d51ee9b9d2
3 changed files with 22 additions and 12 deletions
|
@ -1,6 +1,8 @@
|
|||
package com.projectkorra.ProjectKorra.Ability;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -17,11 +19,11 @@ public class AbilityModuleManager {
|
|||
private final AbilityLoader<AbilityModule> loader;
|
||||
|
||||
public static HashSet<String> abilities;
|
||||
public static HashSet<String> waterbendingabilities;
|
||||
public static HashSet<String> airbendingabilities;
|
||||
public static HashSet<String> earthbendingabilities;
|
||||
public static HashSet<String> firebendingabilities;
|
||||
public static HashSet<String> chiabilities;
|
||||
public static List<String> waterbendingabilities;
|
||||
public static List<String> airbendingabilities;
|
||||
public static List<String> earthbendingabilities;
|
||||
public static List<String> firebendingabilities;
|
||||
public static List<String> chiabilities;
|
||||
public static HashSet<String> shiftabilities;
|
||||
public static HashMap<String, String> authors;
|
||||
public static HashSet<String> harmlessabilities;
|
||||
|
@ -39,11 +41,11 @@ public class AbilityModuleManager {
|
|||
}
|
||||
loader = new AbilityLoader<AbilityModule>(plugin, path, new Object[] {});
|
||||
abilities = new HashSet<String>();
|
||||
waterbendingabilities = new HashSet<String>();
|
||||
airbendingabilities = new HashSet<String>();
|
||||
earthbendingabilities = new HashSet<String>();
|
||||
firebendingabilities = new HashSet<String>();
|
||||
chiabilities = new HashSet<String>();
|
||||
waterbendingabilities = new ArrayList<String>();
|
||||
airbendingabilities = new ArrayList<String>();
|
||||
earthbendingabilities = new ArrayList<String>();
|
||||
firebendingabilities = new ArrayList<String>();
|
||||
chiabilities = new ArrayList<String>();
|
||||
shiftabilities = new HashSet<String>();
|
||||
descriptions = new HashMap<String, String>();
|
||||
authors = new HashMap<String, String>();
|
||||
|
@ -154,6 +156,12 @@ public class AbilityModuleManager {
|
|||
descriptions.put(ab.getName(), ab.getDescription());
|
||||
authors.put(ab.getName(), ab.getAuthor());
|
||||
}
|
||||
|
||||
Collections.sort(airbendingabilities);
|
||||
Collections.sort(waterbendingabilities);
|
||||
Collections.sort(earthbendingabilities);
|
||||
Collections.sort(firebendingabilities);
|
||||
Collections.sort(chiabilities);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import java.sql.ResultSet;
|
|||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
@ -404,7 +406,7 @@ public class Commands {
|
|||
s.sendMessage(Methods.getChiColor() + "There are no chiblocking abilities available.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
for (String st: AbilityModuleManager.chiabilities) {
|
||||
if (Methods.hasPermission((Player) s, st)) {
|
||||
s.sendMessage(Methods.getChiColor() + st);
|
||||
|
|
|
@ -570,7 +570,7 @@ public class PKListener implements Listener {
|
|||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Methods.isChiBlocked(player.getName())) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue