From 8024af3c90343899ace8060f2ddda427e6c7dc10 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sat, 20 Jan 2024 10:08:30 +0100 Subject: Backend: ItemCategory + better LorenzeRarity (#811) Categorizes every item using the rarity lore line. Also a better way of getting the item rarity Rarity #811 --- .../skyhanni/test/SkyHanniDebugsAndTests.kt | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/test') diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index ec850f5dd..776d0fca1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -19,6 +19,7 @@ import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull +import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld @@ -398,10 +399,20 @@ class SkyHanniDebugsAndTests { if (!debugConfig.showItemRarity) return val itemStack = event.itemStack - val rarity = itemStack.getItemRarityOrNull(logError = false) + val rarity = itemStack.getItemRarityOrNull() event.toolTip.add("Item rarity: $rarity") } + @SubscribeEvent + fun showItemCategory(event: LorenzToolTipEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!debugConfig.showItemCategory) return + val itemStack = event.itemStack + + val category = itemStack.getItemCategoryOrNull()?.name ?: "UNCLASSIFIED" + event.toolTip.add("Item category: $category") + } + @SubscribeEvent fun onSHowNpcPrice(event: LorenzToolTipEvent) { if (!LorenzUtils.inSkyBlock) return @@ -446,7 +457,7 @@ class SkyHanniDebugsAndTests { // val pitch = event.pitch // val volume = event.volume - //background music + // background music // if (soundName == "note.harp") { //// if (distance < 2) { // @@ -481,7 +492,7 @@ class SkyHanniDebugsAndTests { // } // } - //diana ancestral spade + // diana ancestral spade // if (soundName == "note.harp") { // val list = mutableListOf() // list.add(0.52380955f) @@ -556,7 +567,7 @@ class SkyHanniDebugsAndTests { // } // } - //use ancestral spade + // use ancestral spade // if (soundName == "mob.zombie.infect") { // if (pitch == 1.968254f) { // if (volume == 0.3f) { @@ -566,7 +577,7 @@ class SkyHanniDebugsAndTests { // } // } - //wither shield activated + // wither shield activated // if (soundName == "mob.zombie.remedy") { // if (pitch == 0.6984127f) { // if (volume == 1f) { @@ -575,7 +586,7 @@ class SkyHanniDebugsAndTests { // } // } - //wither shield cooldown over + // wither shield cooldown over // if (soundName == "random.levelup") { // if (pitch == 3f) { // if (volume == 1f) { @@ -584,21 +595,21 @@ class SkyHanniDebugsAndTests { // } // } - //teleport (hyp or aote) + // teleport (hyp or aote) // if (soundName == "mob.endermen.portal") { // if (pitch == 1f && volume == 1f) { // return // } // } - //hyp wither impact + // hyp wither impact // if (soundName == "random.explode") { // if (pitch == 1f && volume == 1f) { // return // } // } - //pick coins up + // pick coins up // if (soundName == "random.orb") { // if (pitch == 1.4920635f && volume == 1f) { // return -- cgit