diff options
| author | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-07-30 17:54:49 +0800 |
|---|---|---|
| committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-07-30 17:54:49 +0800 |
| commit | 22fbe20bc27535d81c213e45777efa9792c11667 (patch) | |
| tree | 28cf6d73bcc3d7e30b7f4bfaacb76f41f7928a82 /src/main/java | |
| parent | 279280c15bae6b4d7e23ac3e189d698fbcd5f4a0 (diff) | |
| download | Skyblocker-22fbe20bc27535d81c213e45777efa9792c11667.tar.gz Skyblocker-22fbe20bc27535d81c213e45777efa9792c11667.tar.bz2 Skyblocker-22fbe20bc27535d81c213e45777efa9792c11667.zip | |
Apply code review suggestions
Diffstat (limited to 'src/main/java')
3 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/de/hysky/skyblocker/mixins/ItemStackMixin.java b/src/main/java/de/hysky/skyblocker/mixins/ItemStackMixin.java index c059100e..2c555475 100644 --- a/src/main/java/de/hysky/skyblocker/mixins/ItemStackMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixins/ItemStackMixin.java @@ -136,6 +136,6 @@ public abstract class ItemStackMixin implements ComponentHolder, SkyblockerStack @NotNull public String getNeuName() { if (neuName != null && !neuName.isEmpty()) return neuName; - return neuName = ItemUtils.getNeuId((ItemStack) (Object) this); + return neuName = ItemUtils.getNeuId((ItemStack) (Object) this); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java index c6cb97ab..a2df2a5c 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java @@ -28,7 +28,7 @@ public class ItemTooltip { /** * @deprecated Use {@link ItemUtils#getNeuId(ItemStack)} instead */ - @Deprecated(since = "1.22") + @Deprecated(since = "1.22.0") public static String getNeuName(String id, String apiId) { LOGGER.error("[Skyblocker Item Tooltip] ItemTooltip.getNeuName is deprecated and will not work. Use ItemStack#getNeuName instead."); return ""; diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java index 84a06b24..0b86a58b 100644 --- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java +++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java @@ -138,7 +138,7 @@ public final class ItemUtils { NbtCompound enchants = customData.getCompound("enchantments"); Optional<String> firstEnchant = enchants.getKeys().stream().findFirst(); String enchant = firstEnchant.orElse(""); - return "ENCHANTMENT_" + enchant.toUpperCase(Locale.ROOT) + "_" + enchants.getInt(enchant); + return "ENCHANTMENT_" + enchant.toUpperCase(Locale.ENGLISH) + "_" + enchants.getInt(enchant); } } @@ -155,7 +155,7 @@ public final class ItemUtils { String splash = customData.contains("splash") ? "_SPLASH" : ""; if (customData.contains("potion") && customData.contains("potion_level")) { return (customData.getString("potion") + "_" + id + "_" + customData.getInt("potion_level") - + enhanced + extended + splash).toUpperCase(Locale.ROOT); + + enhanced + extended + splash).toUpperCase(Locale.ENGLISH); } } @@ -163,7 +163,7 @@ public final class ItemUtils { if (customData.contains("runes")) { NbtCompound runes = customData.getCompound("runes"); String rune = runes.getKeys().stream().findFirst().orElse(""); - return rune.toUpperCase(Locale.ROOT) + "_RUNE_" + runes.getInt(rune); + return rune.toUpperCase(Locale.ENGLISH) + "_RUNE_" + runes.getInt(rune); } } @@ -171,7 +171,7 @@ public final class ItemUtils { if (customData.contains("attributes")) { NbtCompound shards = customData.getCompound("attributes"); String shard = shards.getKeys().stream().findFirst().orElse(""); - return id + "-" + shard.toUpperCase(Locale.ROOT) + "_" + shards.getInt(shard); + return id + "-" + shard.toUpperCase(Locale.ENGLISH) + "_" + shards.getInt(shard); } } @@ -180,11 +180,11 @@ public final class ItemUtils { } case "PARTY_HAT_CRAB", "PARTY_HAT_CRAB_ANIMATED", "BALLOON_HAT_2024" -> { - return id + "_" + customData.getString("party_hat_color").toUpperCase(Locale.ROOT); + return id + "_" + customData.getString("party_hat_color").toUpperCase(Locale.ENGLISH); } case "PARTY_HAT_SLOTH" -> { - return id + "_" + customData.getString("party_hat_emoji").toUpperCase(Locale.ROOT); + return id + "_" + customData.getString("party_hat_emoji").toUpperCase(Locale.ENGLISH); } case "CRIMSON_HELMET", "CRIMSON_CHESTPLATE", "CRIMSON_LEGGINGS", "CRIMSON_BOOTS" -> { @@ -240,7 +240,7 @@ public final class ItemUtils { case "ENCHANTED_BOOK" -> { NbtCompound enchantments = customData.getCompound("enchantments"); String enchant = enchantments.getKeys().stream().findFirst().orElse(""); - yield enchant.toUpperCase(Locale.ROOT) + ";" + enchantments.getInt(enchant); + yield enchant.toUpperCase(Locale.ENGLISH) + ";" + enchantments.getInt(enchant); } case "PET" -> { PetCache.PetInfo petInfo = PetCache.PetInfo.CODEC.parse(JsonOps.INSTANCE, JsonParser.parseString(customData.getString("petInfo"))).getOrThrow(); @@ -249,13 +249,13 @@ public final class ItemUtils { case "RUNE" -> { NbtCompound runes = customData.getCompound("runes"); String rune = runes.getKeys().stream().findFirst().orElse(""); - yield rune.toUpperCase(Locale.ROOT) + "_RUNE;" + runes.getInt(rune); + yield rune.toUpperCase(Locale.ENGLISH) + "_RUNE;" + runes.getInt(rune); } - case "POTION" -> "POTION_" + customData.getString("potion").toUpperCase(Locale.ROOT) + ";" + customData.getInt("potion_level"); + case "POTION" -> "POTION_" + customData.getString("potion").toUpperCase(Locale.ENGLISH) + ";" + customData.getInt("potion_level"); case "ATTRIBUTE_SHARD" -> "ATTRIBUTE_SHARD"; - case "PARTY_HAT_CRAB", "BALLOON_HAT_2024" -> id + "_" + customData.getString("party_hat_color").toUpperCase(Locale.ROOT); - case "PARTY_HAT_CRAB_ANIMATED" -> "PARTY_HAT_CRAB_" + customData.getString("party_hat_color").toUpperCase(Locale.ROOT) + "_ANIMATED"; - case "PARTY_HAT_SLOTH" -> id + "_" + customData.getString("party_hat_emoji").toUpperCase(Locale.ROOT); + case "PARTY_HAT_CRAB", "BALLOON_HAT_2024" -> id + "_" + customData.getString("party_hat_color").toUpperCase(Locale.ENGLISH); + case "PARTY_HAT_CRAB_ANIMATED" -> "PARTY_HAT_CRAB_" + customData.getString("party_hat_color").toUpperCase(Locale.ENGLISH) + "_ANIMATED"; + case "PARTY_HAT_SLOTH" -> id + "_" + customData.getString("party_hat_emoji").toUpperCase(Locale.ENGLISH); default -> id.replace(":", "-"); }; } |
