summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-15 23:59:15 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-15 23:59:15 +0200
commit3539dbe69a0782c519aa7d0fd38b7b58df154fd8 (patch)
treebd800256829c8ebd7533a119fdc69fa6c4c526ed /src/main/java/at/hannibal2/skyhanni/utils
parente8acfdf4549ff84636a1b42c52e9c879d3c8d558 (diff)
downloadskyhanni-3539dbe69a0782c519aa7d0fd38b7b58df154fd8.tar.gz
skyhanni-3539dbe69a0782c519aa7d0fd38b7b58df154fd8.tar.bz2
skyhanni-3539dbe69a0782c519aa7d0fd38b7b58df154fd8.zip
add attribute fusion gui to hide not clickable
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 83b4ae3da..6d84c7285 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -2,6 +2,8 @@ package at.hannibal2.skyhanni.utils
import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex
import at.hannibal2.skyhanni.utils.LorenzUtils.removeColorCodes
+import com.google.gson.GsonBuilder
+import com.google.gson.JsonObject
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.item.ItemStack
@@ -75,4 +77,22 @@ object ItemUtils {
return map
}
+
+ fun hasAttributes(stack: ItemStack): Boolean {
+ if (stack.hasTagCompound()) {
+ val tagCompound = stack.tagCompound
+ if (tagCompound.hasKey("ExtraAttributes")) {
+ val extraAttributes = tagCompound.getCompoundTag("ExtraAttributes")
+ try {
+ val json = GsonBuilder().create().fromJson(extraAttributes.toString(), JsonObject::class.java)
+ if (json.has("attributes")) {
+ return true
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
+ }
+ return false
+ }
} \ No newline at end of file