aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-17 15:48:32 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-17 15:48:32 +0200
commit2728b7c116b0f4f65dd5c64eb6d123ca92ebcd36 (patch)
tree9bcd1f6974596ba555a6bd82a7e95e68e17e42b8 /src/main/java/at/hannibal2
parent210acc597ffa1b1213ebd7482d03b13670e4cee5 (diff)
downloadskyhanni-2728b7c116b0f4f65dd5c64eb6d123ca92ebcd36.tar.gz
skyhanni-2728b7c116b0f4f65dd5c64eb6d123ca92ebcd36.tar.bz2
skyhanni-2728b7c116b0f4f65dd5c64eb6d123ca92ebcd36.zip
Added dev option to show item uuid in item lore
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DevData.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt21
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt2
4 files changed, 32 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 978885f66..669824c0b 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -67,6 +67,7 @@ import at.hannibal2.skyhanni.features.summonings.SummoningMobManager
import at.hannibal2.skyhanni.features.summonings.SummoningSoulsName
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.test.PacketTest
+import at.hannibal2.skyhanni.test.ShowItemUuid
import at.hannibal2.skyhanni.test.SkyHanniTestCommand
import at.hannibal2.skyhanni.test.TestBingo
import at.hannibal2.skyhanni.test.command.CopyNearbyParticlesCommand
@@ -297,6 +298,7 @@ class SkyHanniMod {
loadModule(DetectBrokenHyperion())
loadModule(RestorePieceOfWizardPortalLore())
loadModule(QuickModMenuSwitch)
+ loadModule(ShowItemUuid())
init()
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java
index 85120f929..e8061e926 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java
@@ -42,12 +42,18 @@ public class DevData {
public boolean modMenuLog = false;
@Expose
- @ConfigOption(name = "Show internal name", desc = "Show internal names in item lores.")
+ @ConfigOption(name = "Show internal name", desc = "Show internal names in item lore.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 0)
public boolean showInternalName = false;
@Expose
+ @ConfigOption(name = "Show item UUID", desc = "Show the Unique Identifier of items. in the lore.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean showItemUuid = false;
+
+ @Expose
public Position debugPos = new Position(10, 10, false, true);
@Expose
diff --git a/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt b/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt
new file mode 100644
index 000000000..d37d52be0
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt
@@ -0,0 +1,21 @@
+package at.hannibal2.skyhanni.test
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getItemUuid
+import net.minecraftforge.event.entity.player.ItemTooltipEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class ShowItemUuid {
+
+ @SubscribeEvent
+ fun onItemTooltipLow(event: ItemTooltipEvent) {
+ if (!SkyHanniMod.feature.dev.showItemUuid) return
+ val itemStack = event.itemStack
+ if (itemStack != null) {
+ itemStack.getItemUuid()?.let {
+ event.toolTip.add("ยง7Item UUID: '$it'")
+ }
+ }
+ }
+
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 8d937956d..87308e495 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -139,6 +139,8 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getRecipientName() = getAttributeString("recipient_name")
+ fun ItemStack.getItemUuid() = getAttributeString("uuid")
+
fun ItemStack.getGemstones() = getExtraAttributes()?.let {
val list = mutableListOf<GemstoneSlot>()
for (attributes in it.keySet) {