From 71986bac22e7458afb9cb106ec8327100f55cdf0 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 17 Sep 2022 10:20:41 +0200 Subject: add skin texture to copyentities --- src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') 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 -- cgit