diff options
author | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-04-12 18:10:12 -0400 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-04-12 18:10:12 -0400 |
commit | 27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9 (patch) | |
tree | 572a952b05a30afaf2632bbbcee7ef770be40463 /src/main/java/de/hysky/skyblocker/skyblock/item | |
parent | 1c6fffb0c191074d09d993fb24ce9c24c234f5f4 (diff) | |
download | Skyblocker-27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9.tar.gz Skyblocker-27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9.tar.bz2 Skyblocker-27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9.zip |
Refactor fancy auction house
- Add color and center rarity filter text
- Use ItemUtils.getNbtTooltips
- Use longs for item prices
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/item')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/item/ItemRarityBackgrounds.java | 2 | ||||
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockItemRarity.java | 11 |
2 files changed, 7 insertions, 6 deletions
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> SPRITE = () -> MinecraftClient.getInstance().getGuiAtlasManager().getSprite(CONFIG.itemRarityBackgroundStyle.tex); - private static final ImmutableMap<String, SkyblockItemRarity> LORE_RARITIES = ImmutableMap.ofEntries( + public static final ImmutableMap<String, SkyblockItemRarity> 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; } } |