Reduce permissions checking when generating /help

This commit is contained in:
KHobbits 2012-12-20 22:54:36 +00:00
parent adb75b69c2
commit 1218a0b217

View File

@ -47,6 +47,7 @@ public class HelpInput implements IText
newLines.clear();
lines.add(_("helpFrom", p.getDescription().getName()));
}
final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow);
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
{
@ -81,7 +82,7 @@ public class HelpInput implements IText
{
permissions = value.get(PERMISSIONS);
}
if (user.isAuthorized("essentials.help." + pluginNameLow))
if (isOnWhitelist)
{
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
}