From 68d16995e0fafba25cd8a3e4aeafd6ba297301d9 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 14 Nov 2013 10:43:24 +1300 Subject: [PATCH] Made the permission option baby also stand for setbaby --- .../libraryaddict/disguise/BaseDisguiseCommand.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index f661b58f..d356b0ad 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -35,10 +35,12 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { for (DisguiseType type : DisguiseType.values()) { String name = type.name().toLowerCase(); if (perm.split("//.")[0].equals("*") && permission.getValue()) { - names.add(name); + if (!names.contains(name)) + names.add(name); } else if (perm.split("//.")[0].equals(name)) { if (permission.getValue()) { - names.add(name); + if (!names.contains(name)) + names.add(name); } else { forbiddenDisguises.add(name); } @@ -46,6 +48,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } } } + // This does the disguises for ops. for (DisguiseType type : DisguiseType.values()) { if (!names.contains(type.name().toLowerCase())) { if (sender.hasPermission(permissionNode + "*") @@ -97,7 +100,11 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { if (s.length() == 0) return new HashSet>(); HashSet p = new HashSet(); - p.addAll(Arrays.asList(s.split("\\."))); + for (String str : s.split("\\.")) { + if (str.equals("baby")) + str = "setbaby"; + p.add(str); + } perms.add(p); } }