From e3ff9f28036a5791c5aee30e952b335718c22792 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 10 Mar 2013 02:04:11 +0000 Subject: [PATCH] Use lower locale. --- Essentials/src/com/earth2me/essentials/MetaItemStack.java | 6 +++--- Essentials/src/com/earth2me/essentials/SpawnMob.java | 4 ++-- .../src/com/earth2me/essentials/commands/Commandsudo.java | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index ce6fda454..11e19aaca 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -160,7 +160,7 @@ public class MetaItemStack final IText input = new BookInput("book", true, ess); final BookPager pager = new BookPager(input); - if (hasMetaPermission(sender, "chapter", true, true, ess) || hasMetaPermission(sender, "chapter-" + split[1].toLowerCase(), true, true, ess)) + if (hasMetaPermission(sender, "chapter", true, true, ess) || hasMetaPermission(sender, "chapter-" + split[1].toLowerCase(Locale.ENGLISH), true, true, ess)) { List pages = pager.getPages(split[1]); meta.setPages(pages); @@ -349,7 +349,7 @@ public class MetaItemStack pEffectType = Potions.getByName(split[1]); if (pEffectType != null && pEffectType.getName() != null) { - if (hasMetaPermission(sender, "potions." + pEffectType.getName().toLowerCase(), false, false, ess)) + if (hasMetaPermission(sender, "potions." + pEffectType.getName().toLowerCase(Locale.ENGLISH), false, false, ess)) { validPotionEffect = true; canceledEffect = false; @@ -357,7 +357,7 @@ public class MetaItemStack else { canceledEffect = true; - sender.sendMessage(_("invalidPotionEffect", pEffectType.getName().toLowerCase())); + sender.sendMessage(_("invalidPotionEffect", pEffectType.getName().toLowerCase(Locale.ENGLISH))); } } else diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index 06259b997..3ee63ee46 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -24,7 +24,7 @@ public class SpawnMob final Set availableList = new HashSet(); for (String mob : mobList) { - if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) + if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase(Locale.ENGLISH))) { availableList.add(mob); } @@ -166,7 +166,7 @@ public class SpawnMob throw new Exception(_("disabledToSpawnMob")); } - if (sender instanceof User && !((User)sender).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase())) + if (sender instanceof User && !((User)sender).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase(Locale.ENGLISH))) { throw new Exception(_("noPermToSpawnMob")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index b2bd5d14b..6efa138c6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Server; @@ -27,7 +28,7 @@ public class Commandsudo extends EssentialsCommand } final User user = getPlayer(server, args, 0, false); - if(args[1].toLowerCase().startsWith("c:")) + if(args[1].toLowerCase(Locale.ENGLISH).startsWith("c:")) { if (user.isAuthorized("essentials.sudo.exempt") && sender instanceof Player) {