mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-27 02:13:52 -07:00
BUILDTOOLS-251: Make much of Bukkit locale independent
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user