fix: Players not rendering in mob recipes

This commit is contained in:
Linnea Gräf
2024-11-13 15:02:33 +01:00
parent 68020ee516
commit 2c3aa3bd84

View File

@@ -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
}