aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
authorappable <enzospiacitelli@gmail.com>2023-04-12 06:09:48 -0700
committerGitHub <noreply@github.com>2023-04-12 15:09:48 +0200
commit6a4663673cb244fb265bb08f96165d4929e72f0c (patch)
tree9840d09dd34f4df40382574868d568373e3ee84d /src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
parentd5dbe653bb865e85d0f433313ab11e21efdaed39 (diff)
downloadskyhanni-6a4663673cb244fb265bb08f96165d4929e72f0c.tar.gz
skyhanni-6a4663673cb244fb265bb08f96165d4929e72f0c.tar.bz2
skyhanni-6a4663673cb244fb265bb08f96165d4929e72f0c.zip
Farming fortune accessory support (#37)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 25d67bb07..2549c215b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -12,6 +12,7 @@ import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.RenderHelper
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
+import net.minecraft.nbt.NBTTagCompound
object NEUItems {
private val manager: NEUManager get() = NotEnoughUpdates.INSTANCE.manager
@@ -47,6 +48,10 @@ object NEUItems {
.resolveInternalName() ?: ""
}
+ fun getInternalNameOrNull(nbt: NBTTagCompound): String? {
+ return ItemResolutionQuery(manager).withItemNBT(nbt).resolveInternalName()
+ }
+
fun getPriceOrNull(internalName: String, useSellingPrice: Boolean = false): Double? {
val price = getPrice(internalName, useSellingPrice)
if (price == -1.0) {