diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-28 20:12:44 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-28 20:12:44 +0200 |
commit | 279127f1e23d66ed7e9b2bf63c81b1100f09c0ff (patch) | |
tree | 37a1e5fe47c6d27539d9b5730ad98a3f1140bedc | |
parent | 0772a592c875ad9e9fde42e2f3106935b0ffb190 (diff) | |
download | skyhanni-279127f1e23d66ed7e9b2bf63c81b1100f09c0ff.tar.gz skyhanni-279127f1e23d66ed7e9b2bf63c81b1100f09c0ff.tar.bz2 skyhanni-279127f1e23d66ed7e9b2bf63c81b1100f09c0ff.zip |
added npc price display as debug option
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt | 25 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java index f7ee9f765..751e48a1c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java @@ -47,6 +47,12 @@ public class DevConfig { public boolean showInternalName = false; @Expose + @ConfigOption(name = "Show NPC Price", desc = "Show NPC price in item lore.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean showNpcPrice = false; + + @Expose @ConfigOption(name = "Show empty internal names", desc = "Shows internal name even for items with none.") @ConfigEditorBoolean @ConfigAccordionId(id = 0) diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt index 684a1a97d..8cbc28855 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt @@ -10,6 +10,9 @@ import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorColorNames import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull +import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull +import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import net.minecraft.nbt.NBTTagCompound @@ -224,14 +227,22 @@ class SkyHanniTestCommand { } @SubscribeEvent - fun onItemTooltipLow(event: ItemTooltipEvent) { + fun onShowInternalName(event: ItemTooltipEvent) { if (!SkyHanniMod.feature.dev.showInternalName) return - val itemStack = event.itemStack - if (itemStack != null) { - val internalName = itemStack.getInternalName() - if ((internalName == NEUInternalName.NONE) && !SkyHanniMod.feature.dev.showEmptyNames) return - event.toolTip.add("Internal Name: '${internalName.asString()}'") - } + val itemStack = event.itemStack ?: return + val internalName = itemStack.getInternalName() + if ((internalName == NEUInternalName.NONE) && !SkyHanniMod.feature.dev.showEmptyNames) return + event.toolTip.add("Internal Name: '${internalName.asString()}'") + } + + @SubscribeEvent + fun onSHowNpcPrice(event: ItemTooltipEvent) { + if (!SkyHanniMod.feature.dev.showNpcPrice) return + val itemStack = event.itemStack ?: return + val internalName = itemStack.getInternalNameOrNull() ?: return + + val npcPrice = internalName.getNpcPriceOrNull() ?: return + event.toolTip.add("§7Npc price: §6${npcPrice.addSeparators()}") } @SubscribeEvent |