diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 15:28:48 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 15:28:48 +0200 |
commit | f7f341b927c42b1fa9ee47549f35f9e0ba2bb36d (patch) | |
tree | c8587cea3fcbf7c5541bd62aff7fac08437f2570 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 18360356893db95f3fd49c19906ff18d19ea298a (diff) | |
download | skyhanni-f7f341b927c42b1fa9ee47549f35f9e0ba2bb36d.tar.gz skyhanni-f7f341b927c42b1fa9ee47549f35f9e0ba2bb36d.tar.bz2 skyhanni-f7f341b927c42b1fa9ee47549f35f9e0ba2bb36d.zip |
Added dev options to copy bestiary data from inventory
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 8 |
1 files changed, 8 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 1683f90e0..3df9e4673 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -141,6 +141,14 @@ object ItemUtils { .getTagList("textures", Constants.NBT.TAG_COMPOUND).getCompoundTagAt(0).getString("Value") } + fun ItemStack.getSkullOwner(): String? { + if (item != Items.skull) return null + if (tagCompound == null) return null + val nbt = tagCompound + if (!nbt.hasKey("SkullOwner")) return null + return nbt.getCompoundTag("SkullOwner").getString("Id") + } + fun ItemStack.getItemRarity(): Int { //todo make into an enum in future return when (this.getLore().lastOrNull()?.take(4)) { |