Skip to content

Commit

Permalink
duplicated code
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Oct 1, 2024
1 parent c1fa411 commit 1b4f91f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,7 @@ object ItemUtils {
.getCompoundTagAt(0).getString("Value")
}

fun ItemStack.getSkullOwnerId(): 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.getSkullOwnerId(): String? = getSkullOwner()?.getString("Id")

fun ItemStack.getSkullOwner(): NBTTagCompound? {
if (item != Items.skull) return null
Expand Down

0 comments on commit 1b4f91f

Please sign in to comment.