From eb7f8ac4b8ddcb420e6e63cfda9d8db9941d1bf5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 24 Feb 2023 19:47:08 +0100 Subject: Using neu's isVanilla method. --- src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 4 ++++ src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 62546ee81..c22a72971 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -115,6 +115,10 @@ object ItemUtils { fun ItemStack.getInternalName() = NEUItems.getInternalName(this) + fun ItemStack.isVanilla() = NEUItems.isVanillaItem(this) + + fun ItemStack.isEnchanted() = isItemEnchanted + fun ItemStack.getSkullTexture(): String? { if (item != Items.skull) return null if (tagCompound == null) return null diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index dec6964e2..d22a82759 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import io.github.moulberry.notenoughupdates.NEUManager import io.github.moulberry.notenoughupdates.NotEnoughUpdates import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery @@ -39,6 +40,8 @@ object NEUItems { return itemStack.copy() } + fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName()) + fun ItemStack.renderOnScreen(x: Float, y: Float) { GlStateManager.pushMatrix() val isSkull = item === Items.skull -- cgit