From 18ea34b92d6106afda3b662256a2dc36dd4d8ec0 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:09:47 +1000 Subject: Fix Hex overriding bz and added icons to new gemstones in /hex (#1119) --- .../moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java | 12 ++++++++++++ .../moulberry/notenoughupdates/miscgui/hex/HexItem.java | 8 +++++++- .../moulberry/notenoughupdates/miscgui/hex/ItemType.java | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java index f2b7b1c8..2e368f79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -296,8 +296,12 @@ public class GuiCustomHex extends Gui { GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); ContainerChest cc = (ContainerChest) chest.inventorySlots; ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); + ItemStack bookStack = cc.getLowerChestInventory().getStackInSlot(32); CalendarOverlay.ableToClickCalendar = !(shouldOverrideET || shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp); + if (bookStack != null && bookStack.getItem() == Items.book) { + shouldOverrideGemstones = false; + } if (hexStack != null && hexStack.getItem() == Items.experience_bottle) return (shouldOverrideET || shouldOverrideFast); if (!shouldOverrideFast && !shouldOverrideET && !shouldOverrideGemstones && !shouldOverrideXp) { @@ -3076,6 +3080,14 @@ public class GuiCustomHex extends Gui { } else if (item.itemType == ItemType.OPAL_GEMSTONE) { levelStr = "❂"; + } else if (item.itemType == ItemType.ONYX_GEMSTONE) { + levelStr = "☠"; + } else if (item.itemType == ItemType.AQUAMARINE_GEMSTONE) { + levelStr = "α"; + } else if (item.itemType == ItemType.CITRINE_GEMSTONE) { + levelStr = "☘"; + } else if (item.itemType == ItemType.PERIDOT_GEMSTONE) { + levelStr = "☘"; } } else { levelStr = "?"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java index ab871888..11e0dc6d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java @@ -219,6 +219,10 @@ public class HexItem { if (itemName.contains("Amber Gemstone")) this.itemType = ItemType.AMBER_GEMSTONE; if (itemName.contains("Opal Gemstone")) this.itemType = ItemType.OPAL_GEMSTONE; if (itemName.contains("Topaz Gemstone")) this.itemType = ItemType.TOPAZ_GEMSTONE; + if (itemName.contains("Onyx Gemstone")) this.itemType = ItemType.ONYX_GEMSTONE; + if (itemName.contains("Aquamarine Gemstone")) this.itemType = ItemType.AQUAMARINE_GEMSTONE; + if (itemName.contains("Citrine Gemstone")) this.itemType = ItemType.CITRINE_GEMSTONE; + if (itemName.contains("Peridot Gemstone")) this.itemType = ItemType.PERIDOT_GEMSTONE; if (itemName.contains("Gemstone Slot")) this.itemType = ItemType.GEMSTONE_SLOT; if (this.itemName.contains(" Gemstone")) { this.itemName = this.itemName.replace(" Gemstone", "").substring(2); @@ -293,7 +297,9 @@ public class HexItem { return itemType == ItemType.RUBY_GEMSTONE || itemType == ItemType.AMETHYST_GEMSTONE || itemType == ItemType.SAPPHIRE_GEMSTONE || itemType == ItemType.JASPER_GEMSTONE || itemType == ItemType.JADE_GEMSTONE || itemType == ItemType.AMBER_GEMSTONE || - itemType == ItemType.OPAL_GEMSTONE || itemType == ItemType.TOPAZ_GEMSTONE; + itemType == ItemType.OPAL_GEMSTONE || itemType == ItemType.TOPAZ_GEMSTONE || + itemType == ItemType.ONYX_GEMSTONE || itemType == ItemType.AQUAMARINE_GEMSTONE || + itemType == ItemType.CITRINE_GEMSTONE || itemType == ItemType.PERIDOT_GEMSTONE; } public boolean isEnrichment() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java index 48323055..9e20edd4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java @@ -62,6 +62,10 @@ enum ItemType { AMBER_GEMSTONE, OPAL_GEMSTONE, TOPAZ_GEMSTONE, + ONYX_GEMSTONE, + AQUAMARINE_GEMSTONE, + CITRINE_GEMSTONE, + PERIDOT_GEMSTONE, CONVERT_TO_DUNGEON, GEMSTONE_SLOT, EXPERIENCE_BOTTLE, -- cgit