aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt25
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