diff --git a/pom.xml b/pom.xml
index 016e0278..2013f419 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
LibsDisguises
LibsDisguises
- 8.2.6
+ 8.2.6-SNAPSHOT
src
diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java
index d33d0f2c..e80ae800 100644
--- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java
+++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java
@@ -65,18 +65,24 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
if (perms.get(perm)) {
perm = perm.substring(permissionNode.length());
String disguiseType = perm.split("\\.")[0];
- try {
- DisguiseType type = DisguiseType.valueOf(disguiseType.toUpperCase());
+ DisguiseType dType = null;
+ for (DisguiseType t : DisguiseType.values()) {
+ if (t.name().replace("_", "").equalsIgnoreCase(disguiseType.replace("_", ""))) {
+ dType = t;
+ break;
+ }
+ }
+ if (dType != null) {
HashMap, Boolean> list;
- if (singleDisguises.containsKey(type)) {
- list = singleDisguises.get(type);
+ if (singleDisguises.containsKey(dType)) {
+ list = singleDisguises.get(dType);
} else {
list = new HashMap, Boolean>();
- singleDisguises.put(type, list);
+ singleDisguises.put(dType, list);
}
HashMap, Boolean> map1 = getOptions(perm);
list.put(map1.keySet().iterator().next(), map1.values().iterator().next());
- } catch (Exception ex) {
+ } else {
for (DisguiseType type : DisguiseType.values()) {
HashMap, Boolean> options = null;
Class entityClass = type.getEntityType() == null ? Entity.class : type.getEntityType().getEntityClass();
@@ -122,10 +128,16 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
if (!perms.get(perm)) {
perm = perm.substring(permissionNode.length());
String disguiseType = perm.split("\\.")[0];
- try {
- DisguiseType type = DisguiseType.valueOf(disguiseType.toUpperCase());
- singleDisguises.remove(type);
- } catch (Exception ex) {
+ DisguiseType dType = null;
+ for (DisguiseType t : DisguiseType.values()) {
+ if (t.name().replace("_", "").equalsIgnoreCase(disguiseType.replace("_", ""))) {
+ dType = t;
+ break;
+ }
+ }
+ if (dType != null) {
+ singleDisguises.remove(dType);
+ } else {
for (DisguiseType type : DisguiseType.values()) {
boolean foundHim = false;
Class entityClass = type.getEntityType() == null ? Entity.class : type.getEntityType().getEntityClass();