From 2c3aa3bd84e6a129ca189ce0bc8d5705bc53ee72 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 13 Nov 2024 15:02:33 +0100 Subject: fix: Players not rendering in mob recipes --- src/main/kotlin/gui/entity/GuiPlayer.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/kotlin/gui/entity/GuiPlayer.kt b/src/main/kotlin/gui/entity/GuiPlayer.kt index aa0bea8..d6d5586 100644 --- a/src/main/kotlin/gui/entity/GuiPlayer.kt +++ b/src/main/kotlin/gui/entity/GuiPlayer.kt @@ -9,6 +9,7 @@ import net.minecraft.client.util.SkinTextures.Model import net.minecraft.client.world.ClientWorld import net.minecraft.util.Identifier import net.minecraft.util.math.BlockPos +import net.minecraft.util.math.Vec3d import net.minecraft.world.World /** @@ -21,7 +22,9 @@ fun makeGuiPlayer(world: World): GuiPlayer { Float::class.javaPrimitiveType, GameProfile::class.java ) - return constructor.newInstance(world, BlockPos.ORIGIN, 0F, GameProfile(UUID.randomUUID(), "Linnea")) + val player = constructor.newInstance(world, BlockPos.ORIGIN, 0F, GameProfile(UUID.randomUUID(), "Linnea")) + player.postInit() + return player } class GuiPlayer(world: ClientWorld?, profile: GameProfile?) : AbstractClientPlayerEntity(world, profile) { @@ -29,6 +32,10 @@ class GuiPlayer(world: ClientWorld?, profile: GameProfile?) : AbstractClientPlay return false } + fun postInit() { + lastVelocity = Vec3d.ZERO + } + override fun isCreative(): Boolean { return false } -- cgit