From f2755fcb8ba927e2e26373c74cc09ef978d59fed Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 24 Nov 2013 08:53:25 +1300 Subject: [PATCH] Do the changes for the base disguise command --- .../utilities/BaseDisguiseCommand.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index 8c23ddca..0f2f228c 100644 --- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -19,6 +19,7 @@ import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.potion.PotionEffectType; public abstract class BaseDisguiseCommand implements CommandExecutor { + protected ArrayList getAllowedDisguises(CommandSender sender) { String permissionNode = "libsdisguises." + getClass().getSimpleName().replace("Command", "").toLowerCase() + "."; return getAllowedDisguises(sender, permissionNode); @@ -203,6 +204,18 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } } } + if (miscId != -1) { + if (disguiseType == DisguiseType.FALLING_BLOCK) { + usedOptions.add("setblock"); + doCheck(optionPermissions, usedOptions); + } else if (disguiseType == DisguiseType.PAINTING) { + usedOptions.add("setpainting"); + doCheck(optionPermissions, usedOptions); + } else if (disguiseType == DisguiseType.SPLASH_POTION) { + usedOptions.add("setpotionid"); + doCheck(optionPermissions, usedOptions); + } + } // Construct the disguise disguise = new MiscDisguise(disguiseType, miscId, miscData); } @@ -313,6 +326,13 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { throw parseToException("villager profession", valueString, methodName); } // Parse to ocelot type + } else if (param.getSimpleName().equals("Art")) { + try { + value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase()); + } catch (Exception ex) { + throw parseToException("painting", valueString, methodName); + } + // Parse to ocelot type } else if (param.getSimpleName().equals("Type")) { try { value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());