mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 19:15:44 +00:00
Fix for showing plugins when user has no permission.
This commit is contained in:
parent
77c6a3b730
commit
b3de0aabae
1 changed files with 8 additions and 6 deletions
|
@ -36,6 +36,7 @@ public class HelpInput implements IText
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
final List<String> pluginLines = new ArrayList<String>();
|
||||||
final PluginDescriptionFile desc = p.getDescription();
|
final PluginDescriptionFile desc = p.getDescription();
|
||||||
final Map<String, Map<String, Object>> cmds = desc.getCommands();
|
final Map<String, Map<String, Object>> cmds = desc.getCommands();
|
||||||
pluginName = p.getDescription().getName();
|
pluginName = p.getDescription().getName();
|
||||||
|
@ -63,7 +64,7 @@ public class HelpInput implements IText
|
||||||
final String node = "essentials." + k.getKey();
|
final String node = "essentials." + k.getKey();
|
||||||
if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node))
|
if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node))
|
||||||
{
|
{
|
||||||
newLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -82,7 +83,7 @@ public class HelpInput implements IText
|
||||||
}
|
}
|
||||||
if (user.isAuthorized("essentials.help." + pluginNameLow))
|
if (user.isAuthorized("essentials.help." + pluginNameLow))
|
||||||
{
|
{
|
||||||
newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
else if (permissions instanceof List && !((List<Object>)permissions).isEmpty())
|
else if (permissions instanceof List && !((List<Object>)permissions).isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -97,21 +98,21 @@ public class HelpInput implements IText
|
||||||
}
|
}
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
{
|
||||||
newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (permissions instanceof String && !"".equals(permissions))
|
else if (permissions instanceof String && !"".equals(permissions))
|
||||||
{
|
{
|
||||||
if (user.isAuthorized(permissions.toString()))
|
if (user.isAuthorized(permissions.toString()))
|
||||||
{
|
{
|
||||||
newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ess.getSettings().hidePermissionlessHelp())
|
if (!ess.getSettings().hidePermissionlessHelp())
|
||||||
{
|
{
|
||||||
newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,8 +123,9 @@ public class HelpInput implements IText
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!newLines.isEmpty())
|
if (!pluginLines.isEmpty())
|
||||||
{
|
{
|
||||||
|
newLines.addAll(pluginLines);
|
||||||
if (pluginNameLow.equals(match))
|
if (pluginNameLow.equals(match))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue