From 27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:10:12 -0400 Subject: Refactor fancy auction house - Add color and center rarity filter text - Use ItemUtils.getNbtTooltips - Use longs for item prices --- .../hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java | 2 +- .../de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock/item') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java b/src/main/java/de/hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java index c9cdb99a..d4bf3d52 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java @@ -26,7 +26,7 @@ import net.minecraft.text.Text; public class ItemRarityBackgrounds { private static final SkyblockerConfig.ItemInfoDisplay CONFIG = SkyblockerConfigManager.get().general.itemInfoDisplay; private static final Supplier SPRITE = () -> MinecraftClient.getInstance().getGuiAtlasManager().getSprite(CONFIG.itemRarityBackgroundStyle.tex); - private static final ImmutableMap LORE_RARITIES = ImmutableMap.ofEntries( + public static final ImmutableMap LORE_RARITIES = ImmutableMap.ofEntries( Map.entry("ADMIN", SkyblockItemRarity.ADMIN), Map.entry("ULTIMATE", SkyblockItemRarity.ULTIMATE), Map.entry("SPECIAL", SkyblockItemRarity.SPECIAL), //Very special is the same color so this will cover it diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java index 4addeac6..60bda976 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java @@ -15,16 +15,17 @@ public enum SkyblockItemRarity { UNCOMMON(Formatting.GREEN), COMMON(Formatting.WHITE); + public final int color; public final float r; public final float g; public final float b; SkyblockItemRarity(Formatting formatting) { - @SuppressWarnings("DataFlowIssue") - int rgb = formatting.getColorValue(); + //noinspection DataFlowIssue + this.color = formatting.getColorValue(); - this.r = ((rgb >> 16) & 0xFF) / 255f; - this.g = ((rgb >> 8) & 0xFF) / 255f; - this.b = (rgb & 0xFF) / 255f; + this.r = ((color >> 16) & 0xFF) / 255f; + this.g = ((color >> 8) & 0xFF) / 255f; + this.b = (color & 0xFF) / 255f; } } -- cgit