mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
Add missing Locale
This commit is contained in:
parent
b2f7a90c04
commit
e89706db96
8 changed files with 17 additions and 9 deletions
|
@ -2,6 +2,7 @@ package org.bukkit;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.util.OldEnum;
|
import org.bukkit.util.OldEnum;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ public abstract class Fluid extends OldEnum<Fluid> implements Keyed {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Fluid valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(fluid != null, "No Fluid found with the name %s", name);
|
||||||
return fluid;
|
return fluid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.util.OldEnum;
|
import org.bukkit.util.OldEnum;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -194,7 +195,7 @@ public abstract class Statistic extends OldEnum<Statistic> implements Keyed {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Statistic valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(statistic != null, "No Statistic found with the name %s", name);
|
||||||
return statistic;
|
return statistic;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit.attribute;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.Registry;
|
import org.bukkit.Registry;
|
||||||
|
@ -119,7 +120,7 @@ public abstract class Attribute extends OldEnum<Attribute> implements Keyed, Tra
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Attribute valueOf(@NotNull String name) {
|
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) {
|
if (attribute != null) {
|
||||||
return attribute;
|
return attribute;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit.block;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
@ -106,7 +107,7 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Biome valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(biome != null, "No Biome found with the name %s", name);
|
||||||
return biome;
|
return biome;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit.entity;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
@ -76,7 +77,7 @@ public interface Cat extends Tameable, Sittable {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Type valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(type != null, "No cat type found with the name %s", name);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit.entity;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.Registry;
|
import org.bukkit.Registry;
|
||||||
|
@ -78,7 +79,7 @@ public interface Frog extends Animals {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Variant valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(variant != null, "No frog variant found with the name %s", name);
|
||||||
return variant;
|
return variant;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.bukkit.entity;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
@ -147,7 +148,7 @@ public interface Villager extends AbstractVillager {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Type valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(type != null, "No villager type found with the name %s", name);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +257,7 @@ public interface Villager extends AbstractVillager {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Profession valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(profession != null, "No villager profession found with the name %s", name);
|
||||||
return profession;
|
return profession;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.bukkit.potion;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import org.bukkit.Keyed;
|
import org.bukkit.Keyed;
|
||||||
import org.bukkit.MinecraftExperimental;
|
import org.bukkit.MinecraftExperimental;
|
||||||
import org.bukkit.MinecraftExperimental.Requires;
|
import org.bukkit.MinecraftExperimental.Requires;
|
||||||
|
@ -143,7 +144,7 @@ public abstract class PotionType extends OldEnum<PotionType> implements Keyed {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static PotionType valueOf(@NotNull String name) {
|
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);
|
Preconditions.checkArgument(potionType != null, "No potion type found with the name %s", name);
|
||||||
return potionType;
|
return potionType;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue