From 197c50083297576974a2b598873cd8811e68133d Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 14 Sep 2014 00:21:39 +1200 Subject: [PATCH] Fix error being thrown when using non-flagwatcher option --- .../disguise/utilities/BaseDisguiseCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index ad682775..74fc4ed7 100644 --- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -581,7 +581,10 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { usedOptions.add(methodName.toLowerCase()); } doCheck(optionPermissions, usedOptions); - methodToUse.invoke(disguise.getWatcher(), value); + if (methodToUse.getDeclaringClass().isAssignableFrom(FlagWatcher.class)) + methodToUse.invoke(disguise.getWatcher(), value); + else + methodToUse.invoke(disguise, value); } // Alright. We've constructed our disguise. return disguise;