BUILDTOOLS-251: Make much of Bukkit locale independent

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2016-06-26 19:31:59 +10:00
parent b54985de63
commit 7f7f1608e8
17 changed files with 41 additions and 41 deletions

View File

@@ -249,7 +249,7 @@ public abstract class PotionEffectType {
*/
public static PotionEffectType getByName(String name) {
Validate.notNull(name, "name cannot be null");
return byName.get(name.toLowerCase());
return byName.get(name.toLowerCase(java.util.Locale.ENGLISH));
}
/**
@@ -260,7 +260,7 @@ public abstract class PotionEffectType {
* @param type PotionType to register
*/
public static void registerPotionEffectType(PotionEffectType type) {
if (byId[type.id] != null || byName.containsKey(type.getName().toLowerCase())) {
if (byId[type.id] != null || byName.containsKey(type.getName().toLowerCase(java.util.Locale.ENGLISH))) {
throw new IllegalArgumentException("Cannot set already-set type");
} else if (!acceptingNew) {
throw new IllegalStateException(
@@ -268,7 +268,7 @@ public abstract class PotionEffectType {
}
byId[type.id] = type;
byName.put(type.getName().toLowerCase(), type);
byName.put(type.getName().toLowerCase(java.util.Locale.ENGLISH), type);
}
/**