1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-19 13:01:20 +02:00

Fix command costs warnings.

This commit is contained in:
KHobbits
2012-12-17 17:43:04 +00:00
parent 1f175dffe1
commit 95906a66ee

View File

@@ -191,10 +191,14 @@ public class Settings implements ISettings
for (String command : section.getKeys(false))
{
PluginCommand cmd = ess.getServer().getPluginCommand(command);
if (cmd == null || !cmd.getPlugin().equals(ess))
if (cmd != null && !cmd.getPlugin().equals(ess))
{
ess.getLogger().warning("Invalid command cost. '" + command + "' is not a command handled by Essentials.");
}
else if (command.charAt(0) == '/')
{
ess.getLogger().warning("Invalid command cost. '" + command + "' should not start with '/'.");
}
if (section.isDouble(command))
{
newSection.set(command.toLowerCase(Locale.ENGLISH), section.getDouble(command));