Add missing Locale

This commit is contained in:
DerFrZocker 2024-06-03 18:26:07 +02:00
parent b2f7a90c04
commit e89706db96
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
8 changed files with 17 additions and 9 deletions

View file

@ -2,6 +2,7 @@ package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.NotNull;
@ -47,7 +48,7 @@ public abstract class Fluid extends OldEnum<Fluid> implements Keyed {
@NotNull
@Deprecated
public static Fluid valueOf(@NotNull String name) {
Fluid fluid = Registry.FLUID.get(NamespacedKey.fromString(name.toLowerCase()));
Fluid fluid = Registry.FLUID.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(fluid != null, "No Fluid found with the name %s", name);
return fluid;
}

View file

@ -2,6 +2,7 @@ package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.NotNull;
@ -194,7 +195,7 @@ public abstract class Statistic extends OldEnum<Statistic> implements Keyed {
@NotNull
@Deprecated
public static Statistic valueOf(@NotNull String name) {
Statistic statistic = Registry.STATISTIC.get(NamespacedKey.fromString(name.toLowerCase()));
Statistic statistic = Registry.STATISTIC.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(statistic != null, "No Statistic found with the name %s", name);
return statistic;
}

View file

@ -2,6 +2,7 @@ package org.bukkit.attribute;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@ -119,7 +120,7 @@ public abstract class Attribute extends OldEnum<Attribute> implements Keyed, Tra
@NotNull
@Deprecated
public static Attribute valueOf(@NotNull String name) {
Attribute attribute = Registry.ATTRIBUTE.get(NamespacedKey.fromString(name.toLowerCase()));
Attribute attribute = Registry.ATTRIBUTE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
if (attribute != null) {
return attribute;
}

View file

@ -2,6 +2,7 @@ package org.bukkit.block;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.Bukkit;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
@ -106,7 +107,7 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
@NotNull
@Deprecated
public static Biome valueOf(@NotNull String name) {
Biome biome = Registry.BIOME.get(NamespacedKey.fromString(name.toLowerCase()));
Biome biome = Registry.BIOME.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(biome != null, "No Biome found with the name %s", name);
return biome;
}

View file

@ -2,6 +2,7 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.DyeColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
@ -76,7 +77,7 @@ public interface Cat extends Tameable, Sittable {
@NotNull
@Deprecated
public static Type valueOf(@NotNull String name) {
Type type = Registry.CAT_VARIANT.get(NamespacedKey.fromString(name.toLowerCase()));
Type type = Registry.CAT_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(type != null, "No cat type found with the name %s", name);
return type;
}

View file

@ -2,6 +2,7 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@ -78,7 +79,7 @@ public interface Frog extends Animals {
@NotNull
@Deprecated
public static Variant valueOf(@NotNull String name) {
Variant variant = Registry.FROG_VARIANT.get(NamespacedKey.fromString(name.toLowerCase()));
Variant variant = Registry.FROG_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(variant != null, "No frog variant found with the name %s", name);
return variant;
}

View file

@ -2,6 +2,7 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
@ -147,7 +148,7 @@ public interface Villager extends AbstractVillager {
@NotNull
@Deprecated
public static Type valueOf(@NotNull String name) {
Type type = Registry.VILLAGER_TYPE.get(NamespacedKey.fromString(name.toLowerCase()));
Type type = Registry.VILLAGER_TYPE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(type != null, "No villager type found with the name %s", name);
return type;
}
@ -256,7 +257,7 @@ public interface Villager extends AbstractVillager {
@NotNull
@Deprecated
public static Profession valueOf(@NotNull String name) {
Profession profession = Registry.VILLAGER_PROFESSION.get(NamespacedKey.fromString(name.toLowerCase()));
Profession profession = Registry.VILLAGER_PROFESSION.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(profession != null, "No villager profession found with the name %s", name);
return profession;
}

View file

@ -3,6 +3,7 @@ package org.bukkit.potion;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.MinecraftExperimental;
import org.bukkit.MinecraftExperimental.Requires;
@ -143,7 +144,7 @@ public abstract class PotionType extends OldEnum<PotionType> implements Keyed {
@NotNull
@Deprecated
public static PotionType valueOf(@NotNull String name) {
PotionType potionType = Registry.POTION.get(NamespacedKey.fromString(name.toLowerCase()));
PotionType potionType = Registry.POTION.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(potionType != null, "No potion type found with the name %s", name);
return potionType;
}