diff --git a/src/com/projectkorra/ProjectKorra/Ability/AbilityModuleManager.java b/src/com/projectkorra/ProjectKorra/Ability/AbilityModuleManager.java index ddeccd37..b337f847 100644 --- a/src/com/projectkorra/ProjectKorra/Ability/AbilityModuleManager.java +++ b/src/com/projectkorra/ProjectKorra/Ability/AbilityModuleManager.java @@ -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 loader; public static HashSet abilities; - public static HashSet waterbendingabilities; - public static HashSet airbendingabilities; - public static HashSet earthbendingabilities; - public static HashSet firebendingabilities; - public static HashSet chiabilities; + public static List waterbendingabilities; + public static List airbendingabilities; + public static List earthbendingabilities; + public static List firebendingabilities; + public static List chiabilities; public static HashSet shiftabilities; public static HashMap authors; public static HashSet harmlessabilities; @@ -39,11 +41,11 @@ public class AbilityModuleManager { } loader = new AbilityLoader(plugin, path, new Object[] {}); abilities = new HashSet(); - waterbendingabilities = new HashSet(); - airbendingabilities = new HashSet(); - earthbendingabilities = new HashSet(); - firebendingabilities = new HashSet(); - chiabilities = new HashSet(); + waterbendingabilities = new ArrayList(); + airbendingabilities = new ArrayList(); + earthbendingabilities = new ArrayList(); + firebendingabilities = new ArrayList(); + chiabilities = new ArrayList(); shiftabilities = new HashSet(); descriptions = new HashMap(); authors = new HashMap(); @@ -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); } } diff --git a/src/com/projectkorra/ProjectKorra/Commands.java b/src/com/projectkorra/ProjectKorra/Commands.java index cb73f09f..43bf1388 100644 --- a/src/com/projectkorra/ProjectKorra/Commands.java +++ b/src/com/projectkorra/ProjectKorra/Commands.java @@ -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); diff --git a/src/com/projectkorra/ProjectKorra/PKListener.java b/src/com/projectkorra/ProjectKorra/PKListener.java index 167fc462..f2455ea7 100644 --- a/src/com/projectkorra/ProjectKorra/PKListener.java +++ b/src/com/projectkorra/ProjectKorra/PKListener.java @@ -570,7 +570,7 @@ public class PKListener implements Listener { event.setCancelled(true); return; } - + if (Methods.isChiBlocked(player.getName())) { event.setCancelled(true); return;