diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt b/src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt new file mode 100644 index 000000000..1cfa2f0c5 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.utils + +import net.minecraft.client.Minecraft +import net.minecraft.client.entity.EntityOtherPlayerMP +import net.minecraft.client.resources.DefaultPlayerSkin +import net.minecraft.entity.player.EnumPlayerModelParts +import net.minecraft.scoreboard.ScorePlayerTeam + +class FakePlayer : EntityOtherPlayerMP(Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.gameProfile) { + + override fun getLocationSkin() = + Minecraft.getMinecraft().thePlayer.locationSkin ?: DefaultPlayerSkin.getDefaultSkin(Minecraft.getMinecraft().thePlayer.uniqueID) + + override fun getTeam() = object : ScorePlayerTeam(null, null) { + override fun getNameTagVisibility() = EnumVisible.NEVER + } + + override fun isWearing(part: EnumPlayerModelParts): Boolean = + Minecraft.getMinecraft().thePlayer.isWearing(part) && part != EnumPlayerModelParts.CAPE +} |