Fix error being thrown when using non-flagwatcher option

This commit is contained in:
libraryaddict 2014-09-14 00:21:39 +12:00
parent 785c864d81
commit 197c500832

View File

@ -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;