diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 11:20:05 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 11:20:05 +0000 |
commit | 4a75929811a8036bb7bb77ad6b99dac81f66c718 (patch) | |
tree | 28e7b11a122cf8ba6ddd5e5d9845d80d72b9c269 | |
parent | 38ec110761bc9b0fae4de68dcc8913ce1eadce2e (diff) | |
download | Essentials-4a75929811a8036bb7bb77ad6b99dac81f66c718.tar Essentials-4a75929811a8036bb7bb77ad6b99dac81f66c718.tar.gz Essentials-4a75929811a8036bb7bb77ad6b99dac81f66c718.tar.lz Essentials-4a75929811a8036bb7bb77ad6b99dac81f66c718.tar.xz Essentials-4a75929811a8036bb7bb77ad6b99dac81f66c718.zip |
We now ignore the case, when we read the kits from config.yml.
Beware, that permissions always have to be lowercase.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1463 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Settings.java | 8 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkit.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 5f1463f77..862c559e1 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -137,7 +137,13 @@ public class Settings implements IConf public Object getKit(String name) { Map<String, Object> kits = (Map<String, Object>)config.getProperty("kits"); - return kits.get(name.replace('.', '_').replace('/', '_')); + for (Map.Entry<String, Object> entry : kits.entrySet()) + { + if (entry.getKey().equalsIgnoreCase(name.replace('.', '_').replace('/', '_'))) { + return entry.getValue(); + } + } + return null; } public ChatColor getOperatorColor() throws Exception diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 4b71374ff..e6b5d1cd1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -33,7 +33,7 @@ public class Commandkit extends EssentialsCommand StringBuilder list = new StringBuilder(); for (String k : kits.keySet()) { - if (user.isAuthorized("essentials.kit." + k)) + if (user.isAuthorized("essentials.kit." + k.toLowerCase())) { list.append(" ").append(k); } @@ -147,7 +147,7 @@ public class Commandkit extends EssentialsCommand { user.sendMessage(ex.getMessage()); } - user.sendMessage(Util.format("kitGive", args[0].toLowerCase())); + user.sendMessage(Util.format("kitGive", kitName)); } catch (Exception ex) { |