mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-25 02:27:33 +01:00
Fix help for plugins which miss command descriptions.
This commit is contained in:
parent
576b48c08c
commit
b851cd10f2
@ -117,16 +117,20 @@ public class Commandhelp extends EssentialsCommand
|
||||
{
|
||||
final PluginDescriptionFile desc = p.getDescription();
|
||||
final HashMap<String, HashMap<String, String>> cmds = (HashMap<String, HashMap<String, String>>)desc.getCommands();
|
||||
pluginName = p.getDescription().getName().toLowerCase();
|
||||
for (Entry<String, HashMap<String, String>> k : cmds.entrySet())
|
||||
{
|
||||
if ((!match.equalsIgnoreCase("")) && (!k.getKey().toLowerCase().contains(match))
|
||||
try
|
||||
{
|
||||
if ((!match.equalsIgnoreCase(""))
|
||||
&& (!k.getKey().toLowerCase().contains(match))
|
||||
&& (!k.getValue().get("description").toLowerCase().contains(match))
|
||||
&& (!p.getDescription().getName().contains(match)))
|
||||
&& (!pluginName.contains(match)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p.getDescription().getName().toLowerCase().contains("essentials"))
|
||||
if (pluginName.contains("essentials"))
|
||||
{
|
||||
final String node = "essentials." + k.getKey();
|
||||
if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node))
|
||||
@ -138,7 +142,6 @@ public class Commandhelp extends EssentialsCommand
|
||||
{
|
||||
if (ess.getSettings().showNonEssCommandsInHelp())
|
||||
{
|
||||
pluginName = p.getDescription().getName();
|
||||
final HashMap<String, String> value = k.getValue();
|
||||
if (value.containsKey("permission") && value.get("permission") != null && !(value.get("permission").equals("")))
|
||||
{
|
||||
@ -166,7 +169,11 @@ public class Commandhelp extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user