aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 10:20:41 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 10:20:41 +0200
commit71986bac22e7458afb9cb106ec8327100f55cdf0 (patch)
tree25b7efa76494f1c91526f034d4b8dac0764975d0 /src/main/java/at/hannibal2/skyhanni/utils
parent147ab9c7ecb212a2104158e9750aed9925b86936 (diff)
downloadskyhanni-71986bac22e7458afb9cb106ec8327100f55cdf0.tar.gz
skyhanni-71986bac22e7458afb9cb106ec8327100f55cdf0.tar.bz2
skyhanni-71986bac22e7458afb9cb106ec8327100f55cdf0.zip
add skin texture to copyentities
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
index d057abd90..e9621b319 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
import net.minecraft.entity.EntityLiving
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
+import net.minecraft.entity.player.EntityPlayer
import net.minecraft.util.AxisAlignedBB
object EntityUtils {
@@ -88,4 +89,14 @@ object EntityUtils {
else -> false
}
}
+
+ fun EntityPlayer.getSkinTexture(): String? {
+ val gameProfile = gameProfile ?: return null
+
+ return gameProfile.properties.entries()
+ .filter { it.key == "textures" }
+ .map { it.value }
+ .firstOrNull { it.name == "textures" }
+ ?.value
+ }
} \ No newline at end of file