aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-09-03 09:59:27 +0200
committerGitHub <noreply@github.com>2024-09-03 09:59:27 +0200
commit2b92f20b8a080be611447635b6f27a7651d49ca0 (patch)
tree0c33aad5dc2e4ab7cb7a6b258c07ec6b48848e99 /src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt
parentc6fd094ab8023588fd9369fe8e959b223d2ec312 (diff)
downloadskyhanni-2b92f20b8a080be611447635b6f27a7651d49ca0.tar.gz
skyhanni-2b92f20b8a080be611447635b6f27a7651d49ca0.tar.bz2
skyhanni-2b92f20b8a080be611447635b6f27a7651d49ca0.zip
Fix: Armor Hider in Custom Wardrobe (#2449)
Co-authored-by: ItsEmpa <itsempa@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/FakePlayer.kt20
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
+}