From 9c78d8dde2f9215cd107dd860c649e73affc9bef Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 12 Jan 2025 00:08:21 -0500 Subject: [PATCH 1/4] HOTM Perk Level Slot Text --- .../skyblock/item/slottext/SlotText.java | 3 ++ .../item/slottext/SlotTextManager.java | 1 + .../slottext/adders/HotmPerkLevelAdder.java | 49 +++++++++++++++++++ .../assets/skyblocker/lang/en_us.json | 1 + 4 files changed, 54 insertions(+) create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java index 43960c9c10..6b45d69733 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java @@ -7,6 +7,9 @@ import java.util.List; public record SlotText(@NotNull Text text, @NotNull TextPosition position) { + public static final int CREAM = 0xFFDDC1; + public static final int GOLD = 0xE5B80B; + public static SlotText bottomLeft(@NotNull Text text) { return new SlotText(text, TextPosition.BOTTOM_LEFT); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotTextManager.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotTextManager.java index f5b9c20062..a6a03a6df9 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotTextManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotTextManager.java @@ -37,6 +37,7 @@ public class SlotTextManager { new MinionLevelAdder(), new PetLevelAdder(), new SkyblockLevelAdder(), + new HotmPerkLevelAdder(), new SkillLevelAdder(), new CatacombsLevelAdder.Dungeoneering(), new CatacombsLevelAdder.DungeonClasses(), diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java new file mode 100644 index 0000000000..1d3ba5e0fe --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java @@ -0,0 +1,49 @@ +package de.hysky.skyblocker.skyblock.item.slottext.adders; + +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import de.hysky.skyblocker.skyblock.item.slottext.SimpleSlotTextAdder; +import de.hysky.skyblocker.skyblock.item.slottext.SlotText; +import de.hysky.skyblocker.utils.ItemUtils; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.screen.slot.Slot; +import net.minecraft.text.Text; + +public class HotmPerkLevelAdder extends SimpleSlotTextAdder { + private static final ConfigInformation CONFIG_INFORMATION = new ConfigInformation( + "hotm_perk_level", + "skyblocker.config.uiAndVisuals.slotText.hotmPerkLevel"); + private static final Pattern LEVEL = Pattern.compile("Level (?\\d+)\\/(?\\d+)"); + + public HotmPerkLevelAdder() { + super("^Heart of the Mountain$", CONFIG_INFORMATION); + } + + @Override + @NotNull + public List getText(@Nullable Slot slot, @NotNull ItemStack stack, int slotId) { + if (slotId >= 0 && slotId <= 53 && !stack.isOf(Items.COAL)) { + List lore = ItemUtils.getLore(stack); + + if (!lore.isEmpty()) { + String levelLine = lore.getFirst().getString(); + Matcher matcher = LEVEL.matcher(levelLine); + + if (matcher.matches()) { + int level = Integer.parseInt(matcher.group("level")); + int max = Integer.parseInt(matcher.group("max")); + + return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(level == max ? SlotText.GOLD : SlotText.CREAM)); + } + } + } + + return List.of(); + } +} diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 058b321de4..32b81c75dd 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -857,6 +857,7 @@ "skyblocker.config.uiAndVisuals.slotText.enchantmentLevel": "Enchantment Book Level", "skyblocker.config.uiAndVisuals.slotText.essenceShop": "Essence Shop", "skyblocker.config.uiAndVisuals.slotText.essenceShop.@Tooltip": "Displays the levels and your current amount of essence while in essence shops.", + "skyblocker.config.uiAndVisuals.slotText.hotmPerkLevel": "HOTM Perk Level", "skyblocker.config.uiAndVisuals.slotText.minionLevel": "Minion Level", "skyblocker.config.uiAndVisuals.slotText.petLevel": "Pet Level", "skyblocker.config.uiAndVisuals.slotText.potionLevel": "Potion Level", From da8fcd07b3a767f9992287d4185cbd5fdd21cf07 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 12 Jan 2025 00:11:29 -0500 Subject: [PATCH 2/4] Add Discrite as an evolving item --- .../skyblock/item/slottext/adders/EvolvingItemAdder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EvolvingItemAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EvolvingItemAdder.java index 8c21334758..e36b19a030 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EvolvingItemAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EvolvingItemAdder.java @@ -29,7 +29,7 @@ public EvolvingItemAdder() { @Override public @NotNull List getText(@Nullable Slot slot, @NotNull ItemStack stack, int slotId) { switch (stack.getSkyblockId()) { - case "NEW_BOTTLE_OF_JYRRE", "DARK_CACAO_TRUFFLE" -> { + case "NEW_BOTTLE_OF_JYRRE", "DARK_CACAO_TRUFFLE", "DISCRITE" -> { return actualLogic(stack, "Current Bonus: "); } case "TRAINING_WEIGHTS" -> { From 149119efa9ec721342a3838d22636cd3d872fcda Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 12 Jan 2025 00:29:28 -0500 Subject: [PATCH 3/4] Replace magic values with constants --- .../hysky/skyblocker/skyblock/WardrobeKeybinds.java | 2 +- .../skyblocker/skyblock/item/slottext/SlotText.java | 11 +++++++++++ .../item/slottext/adders/AttributeShardAdder.java | 4 ++-- .../item/slottext/adders/CatacombsLevelAdder.java | 6 +++--- .../item/slottext/adders/CollectionAdder.java | 4 ++-- .../item/slottext/adders/CommunityShopAdder.java | 6 +++--- .../item/slottext/adders/EnchantmentLevelAdder.java | 4 ++-- .../item/slottext/adders/EssenceShopAdder.java | 4 ++-- .../item/slottext/adders/MinionLevelAdder.java | 2 +- .../item/slottext/adders/NewYearCakeAdder.java | 2 +- .../skyblock/item/slottext/adders/PetLevelAdder.java | 2 +- .../item/slottext/adders/PotionLevelAdder.java | 4 ++-- .../item/slottext/adders/PowerStonesGuideAdder.java | 4 ++-- .../item/slottext/adders/PrehistoricEggAdder.java | 2 +- .../item/slottext/adders/RancherBootsSpeedAdder.java | 2 +- .../item/slottext/adders/SkillLevelAdder.java | 4 ++-- .../item/slottext/adders/SkyblockLevelAdder.java | 2 +- .../item/slottext/adders/StatsTuningAdder.java | 4 ++-- .../item/slottext/adders/YourEssenceAdder.java | 2 +- 19 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/WardrobeKeybinds.java b/src/main/java/de/hysky/skyblocker/skyblock/WardrobeKeybinds.java index 3aa5ffc7e2..9adcf2fffb 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/WardrobeKeybinds.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/WardrobeKeybinds.java @@ -67,7 +67,7 @@ private static boolean allowInput(MinecraftClient client, HandledScreen handl public @NotNull List getText(@Nullable Slot slot, @NotNull ItemStack stack, int slotId) { if (!stack.isOf(Items.PINK_DYE) && !stack.isOf(Items.LIME_DYE)) return List.of(); if (!(slotId >= 36 && slotId <= 44)) return List.of(); - return SlotText.bottomLeftList(Text.literal(String.valueOf(slotId - 35)).withColor(0x74c7ec)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(slotId - 35)).withColor(SlotText.MID_BLUE)); } @Override diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java index 6b45d69733..43924589da 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java @@ -7,8 +7,19 @@ import java.util.List; public record SlotText(@NotNull Text text, @NotNull TextPosition position) { + /** + * The "default" slot text color. + */ public static final int CREAM = 0xFFDDC1; public static final int GOLD = 0xE5B80B; + public static final int LIGHT_BLUE = 0xCFF8F8; + public static final int LIGHT_ORANGE = 0xfab387; + public static final int LIGHT_YELLOW = 0xf9e2af; + public static final int LIGHT_PURPLE = 0xcba6f7; + public static final int LIGHT_RED = 0xFF7276; + public static final int LIGHT_GREEN = 0x90ee90; + public static final int MID_BLUE = 0x74c7ec; + public static final int WHITE = 0xFFFFFF; public static SlotText bottomLeft(@NotNull Text text) { return new SlotText(text, TextPosition.BOTTOM_LEFT); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/AttributeShardAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/AttributeShardAdder.java index 1671936438..a42294c70c 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/AttributeShardAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/AttributeShardAdder.java @@ -87,8 +87,8 @@ public AttributeShardAdder() { String attributeInitials = ID_2_SHORT_NAME.getOrDefault(attributeId, ""); return List.of( - SlotText.bottomRight(Text.literal(String.valueOf(attributeLevel)).withColor(0xFFDDC1)), - SlotText.topLeft(Text.literal(attributeInitials).withColor(0xCFF8F8)) + SlotText.bottomRight(Text.literal(String.valueOf(attributeLevel)).withColor(SlotText.CREAM)), + SlotText.topLeft(Text.literal(attributeInitials).withColor(SlotText.LIGHT_BLUE)) ); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CatacombsLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CatacombsLevelAdder.java index 87a67b9306..0877751c38 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CatacombsLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CatacombsLevelAdder.java @@ -51,7 +51,7 @@ public Dungeoneering() { level = String.valueOf(RomanNumerals.romanToDecimal(roman)); } - return SlotText.bottomLeftList(Text.literal(level).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(level).withColor(SlotText.CREAM)); } default -> { return List.of(); @@ -72,7 +72,7 @@ public DungeonClasses() { case 11, 12, 13, 14, 15 -> { String level = getBracketedLevelFromName(stack); if (!NumberUtils.isDigits(level)) return List.of(); - return SlotText.bottomLeftList(Text.literal(level).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(level).withColor(SlotText.CREAM)); } default -> { return List.of(); @@ -93,7 +93,7 @@ public ReadyUp() { case 29, 30, 31, 32, 33 -> { String level = getBracketedLevelFromName(stack); if (!NumberUtils.isDigits(level)) return List.of(); - return SlotText.bottomLeftList(Text.literal(level).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(level).withColor(SlotText.CREAM)); } default -> { return List.of(); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CollectionAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CollectionAdder.java index 7104a61ddc..3d9153036d 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CollectionAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CollectionAdder.java @@ -31,9 +31,9 @@ public CollectionAdder() { if (matcher.matches()) { int level = RomanNumerals.romanToDecimal(matcher.group("level")); if (ItemUtils.getLoreLineIf(stack, s -> s.contains("Progress to ")) != null) { - return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } else { - return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(0xE5B80B)); + return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(SlotText.GOLD)); } } return List.of(); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CommunityShopAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CommunityShopAdder.java index 9d4a1470ef..630ed727aa 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CommunityShopAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/CommunityShopAdder.java @@ -51,10 +51,10 @@ private static List getTextForUpgradesScreen(ItemStack stack, int slot if (lore.isEmpty()) yield List.of(); String lastLine = lore.getLast().getString(); yield SlotText.bottomLeftList(switch (lastLine) { - case "Maxed out!" -> Text.literal("Max").withColor(0xfab387); - case "Currently upgrading!", "Click to instantly upgrade!" -> Text.literal("⏰").withColor(0xf9e2af).formatted(Formatting.BOLD); + case "Maxed out!" -> Text.literal("Max").withColor(SlotText.LIGHT_ORANGE); + case "Currently upgrading!", "Click to instantly upgrade!" -> Text.literal("⏰").withColor(SlotText.LIGHT_YELLOW).formatted(Formatting.BOLD); case "Click to claim!" -> Text.literal("✅").withColor(0xa6e3a1).formatted(Formatting.BOLD); - default -> Text.literal(String.valueOf(RomanNumerals.romanToDecimal(roman))).withColor(0xcba6f7); + default -> Text.literal(String.valueOf(RomanNumerals.romanToDecimal(roman))).withColor(SlotText.LIGHT_PURPLE); }); } default -> List.of(); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EnchantmentLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EnchantmentLevelAdder.java index 6755370abd..fff7f9948a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EnchantmentLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EnchantmentLevelAdder.java @@ -34,11 +34,11 @@ public EnchantmentLevelAdder() { NbtCompound enchantments = nbt.getCompound("enchantments"); if (enchantments.getSize() != 1) return List.of(); //Only makes sense to display the level when there's one enchant. int level = enchantments.getInt(enchantments.getKeys().iterator().next()); - return SlotText.bottomLeftList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } else { //In bazaar, the books have the enchantment level in the name int level = getEnchantLevelFromString(name); if (level == 0) return List.of(); - return SlotText.bottomLeftList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EssenceShopAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EssenceShopAdder.java index 23b5bee7b1..03f3747921 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EssenceShopAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/EssenceShopAdder.java @@ -40,12 +40,12 @@ public EssenceShopAdder() { if (unlockedMatcher == null) { level -= 1; } - return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } if (essenceAmountMatcher == null) return List.of(); String essenceAmount = essenceAmountMatcher.group("essence").replace(",", ""); if (!essenceAmount.matches("-?\\d+")) return List.of(); - return SlotText.bottomRightList(Text.literal(YourEssenceAdder.COMPACT_NUMBER_FORMATTER.format(Integer.parseInt(essenceAmount))).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(YourEssenceAdder.COMPACT_NUMBER_FORMATTER.format(Integer.parseInt(essenceAmount))).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/MinionLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/MinionLevelAdder.java index 6b723d634b..81faa6eeef 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/MinionLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/MinionLevelAdder.java @@ -31,6 +31,6 @@ public MinionLevelAdder() { String romanNumeral = matcher.group(1); if (!RomanNumerals.isValidRomanNumeral(romanNumeral)) return List.of(); int level = RomanNumerals.romanToDecimal(romanNumeral); - return SlotText.topRightList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.topRightList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java index f81c0df8cf..d5196a1f30 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/NewYearCakeAdder.java @@ -18,6 +18,6 @@ public class NewYearCakeAdder extends SimpleSlotTextAdder { if (!stack.isOf(Items.CAKE)) return List.of(); int year = ItemUtils.getCustomData(stack).getInt("new_years_cake"); if (year <= 0) return List.of(); - return SlotText.bottomLeftList(Text.literal(String.valueOf(year)).withColor(0x74c7ec)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(year)).withColor(SlotText.MID_BLUE)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PetLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PetLevelAdder.java index 61233778c2..ef5ce27d51 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PetLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PetLevelAdder.java @@ -31,6 +31,6 @@ public PetLevelAdder() { if (!matcher.matches()) return List.of(); String level = matcher.group(1); if (!NumberUtils.isDigits(level) || "100".equals(level) || "200".equals(level)) return List.of(); - return SlotText.topLeftList(Text.literal(level).withColor(0xFFDDC1)); + return SlotText.topLeftList(Text.literal(level).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PotionLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PotionLevelAdder.java index 96f3b32f4b..4e06f47a8a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PotionLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PotionLevelAdder.java @@ -29,10 +29,10 @@ public PotionLevelAdder() { if (customData.contains("potion_level", NbtElement.INT_TYPE) && !title.contains("Healer Class") && !title.contains("Class Passives")) { if (title.contains("Healer Level ")){ String level = title.replaceAll("\\D", ""); - return SlotText.bottomRightList(Text.literal(level).withColor(0xFFFFFF)); + return SlotText.bottomRightList(Text.literal(level).withColor(SlotText.WHITE)); } else { int level = customData.getInt("potion_level"); - return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(String.valueOf(level)).withColor(SlotText.CREAM)); } } return List.of(); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PowerStonesGuideAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PowerStonesGuideAdder.java index 967c1cf25c..6336d53242 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PowerStonesGuideAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PowerStonesGuideAdder.java @@ -30,8 +30,8 @@ public PowerStonesGuideAdder() { if (match == null) return List.of(); String symbol = match.group("symbol"); Text text = symbol.equals("✖") - ? Text.literal("✖").withColor(0xFF7276) - : Text.literal("✔").withColor(0x90ee90); + ? Text.literal("✖").withColor(SlotText.LIGHT_RED) + : Text.literal("✔").withColor(SlotText.LIGHT_GREEN); return SlotText.bottomRightList(text); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PrehistoricEggAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PrehistoricEggAdder.java index 3162eeec72..4faad12dd4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PrehistoricEggAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/PrehistoricEggAdder.java @@ -36,6 +36,6 @@ public PrehistoricEggAdder() { else if (walked < 10000) walkedStr = String.format("%.1fk", walked/1000.0f); else walkedStr = walked / 1000 + "k"; - return SlotText.bottomLeftList(Text.literal(walkedStr).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(walkedStr).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/RancherBootsSpeedAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/RancherBootsSpeedAdder.java index 112a9f63ca..07c3195452 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/RancherBootsSpeedAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/RancherBootsSpeedAdder.java @@ -31,6 +31,6 @@ public RancherBootsSpeedAdder() { if (matcher == null) return List.of(); String speed = matcher.group(2); if (speed == null) speed = matcher.group(1); //2nd group only matches when the speed cap is set to a number beyond the player's actual speed cap. - return SlotText.bottomLeftList(Text.literal(speed).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(speed).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkillLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkillLevelAdder.java index 60107abf04..ae121d4055 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkillLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkillLevelAdder.java @@ -31,9 +31,9 @@ public SkillLevelAdder() { String romanNumeral = name.substring(lastIndex + 1); //+1 because we don't need the space itself //The "romanNumeral" might be a latin numeral, too. There's a skyblock setting for this, so we have to do it this way V if (ItemUtils.getLoreLineIf(stack, s -> s.contains("Max Skill level reached!")) != null) { - return SlotText.bottomLeftList(Text.literal(String.valueOf(RomanNumerals.isValidRomanNumeral(romanNumeral) ? RomanNumerals.romanToDecimal(romanNumeral) : Integer.parseInt(romanNumeral))).withColor(0xE5B80B)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(RomanNumerals.isValidRomanNumeral(romanNumeral) ? RomanNumerals.romanToDecimal(romanNumeral) : Integer.parseInt(romanNumeral))).withColor(SlotText.GOLD)); } else { - return SlotText.bottomLeftList(Text.literal(String.valueOf(RomanNumerals.isValidRomanNumeral(romanNumeral) ? RomanNumerals.romanToDecimal(romanNumeral) : Integer.parseInt(romanNumeral))).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(String.valueOf(RomanNumerals.isValidRomanNumeral(romanNumeral) ? RomanNumerals.romanToDecimal(romanNumeral) : Integer.parseInt(romanNumeral))).withColor(SlotText.CREAM)); } } default -> { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkyblockLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkyblockLevelAdder.java index 6f6ff562d8..630589a385 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkyblockLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/SkyblockLevelAdder.java @@ -29,6 +29,6 @@ public SkyblockLevelAdder() { if (siblings.size() < 3) return List.of(); String levelText = siblings.get(2).getString(); //The 3rd child is the level text itself if (!NumberUtils.isDigits(levelText)) return List.of(); - return SlotText.bottomLeftList(Text.literal(levelText).withColor(0xFFDDC1)); + return SlotText.bottomLeftList(Text.literal(levelText).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/StatsTuningAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/StatsTuningAdder.java index b5c70ca0ff..32f0194b6b 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/StatsTuningAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/StatsTuningAdder.java @@ -33,13 +33,13 @@ public StatsTuningAdder() { if (stack.getName().getString().equals("Stats Tuning")) { if (unassignedMatcher == null) return List.of(); String unassignedPoints = unassignedMatcher.group("points"); - return SlotText.bottomRightList(Text.literal(unassignedPoints).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(unassignedPoints).withColor(SlotText.CREAM)); } if (statMatcher == null) return List.of(); String assignedPoints = statMatcher.group("points"); if (assignedPoints.equals("0")) return List.of(); - return SlotText.bottomRightList(Text.literal(assignedPoints).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(assignedPoints).withColor(SlotText.CREAM)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/YourEssenceAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/YourEssenceAdder.java index 3f8bd66d71..4e0ca4e126 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/YourEssenceAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/YourEssenceAdder.java @@ -38,7 +38,7 @@ public YourEssenceAdder() { return essenceAmountMatcher(ItemUtils.getLore(stack)).>map(essenceAmountMatcher -> { String essenceAmount = essenceAmountMatcher.group("essence").replace(",", ""); if (!essenceAmount.matches("-?\\d+")) return List.of(); - return SlotText.bottomRightList(Text.literal(COMPACT_NUMBER_FORMATTER.format(Integer.parseInt(essenceAmount))).withColor(0xFFDDC1)); + return SlotText.bottomRightList(Text.literal(COMPACT_NUMBER_FORMATTER.format(Integer.parseInt(essenceAmount))).withColor(SlotText.CREAM)); }).orElse(List.of()); } return List.of(); From 38ea4ce38076c248da490e6747bf95cbe644fc5e Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sun, 12 Jan 2025 02:54:45 -0500 Subject: [PATCH 4/4] Changes --- .../skyblocker/skyblock/item/slottext/SlotText.java | 10 +++++----- .../item/slottext/adders/HotmPerkLevelAdder.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java index 43924589da..eadcbcef72 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/SlotText.java @@ -13,12 +13,12 @@ public record SlotText(@NotNull Text text, @NotNull TextPosition position) { public static final int CREAM = 0xFFDDC1; public static final int GOLD = 0xE5B80B; public static final int LIGHT_BLUE = 0xCFF8F8; - public static final int LIGHT_ORANGE = 0xfab387; - public static final int LIGHT_YELLOW = 0xf9e2af; - public static final int LIGHT_PURPLE = 0xcba6f7; + public static final int LIGHT_ORANGE = 0xFAB387; + public static final int LIGHT_YELLOW = 0xF9E2AF; + public static final int LIGHT_PURPLE = 0xCBA6F7; public static final int LIGHT_RED = 0xFF7276; - public static final int LIGHT_GREEN = 0x90ee90; - public static final int MID_BLUE = 0x74c7ec; + public static final int LIGHT_GREEN = 0x90EE90; + public static final int MID_BLUE = 0x74C7EC; public static final int WHITE = 0xFFFFFF; public static SlotText bottomLeft(@NotNull Text text) { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java index 1d3ba5e0fe..d6331e5a10 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/slottext/adders/HotmPerkLevelAdder.java @@ -19,7 +19,7 @@ public class HotmPerkLevelAdder extends SimpleSlotTextAdder { private static final ConfigInformation CONFIG_INFORMATION = new ConfigInformation( "hotm_perk_level", "skyblocker.config.uiAndVisuals.slotText.hotmPerkLevel"); - private static final Pattern LEVEL = Pattern.compile("Level (?\\d+)\\/(?\\d+)"); + private static final Pattern LEVEL = Pattern.compile("Level (?\\d+)/(?\\d+)"); public HotmPerkLevelAdder() { super("^Heart of the Mountain$", CONFIG_INFORMATION); @@ -28,7 +28,7 @@ public HotmPerkLevelAdder() { @Override @NotNull public List getText(@Nullable Slot slot, @NotNull ItemStack stack, int slotId) { - if (slotId >= 0 && slotId <= 53 && !stack.isOf(Items.COAL)) { + if (slotId >= 0 && slotId <= 44 && !stack.isOf(Items.COAL)) { List lore = ItemUtils.getLore(stack); if (!lore.isEmpty()) {