From 91cf08f0ac1ade2cad86ccca30e71f31337de9eb Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 21 Jul 2022 16:15:17 +0100 Subject: [PATCH] Fixed pets obstructing the view when looking up --- .../kotlin/com/willfp/ecopets/pets/PetDisplay.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/pets/PetDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/pets/PetDisplay.kt index a68e552..43bbbb7 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/pets/PetDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/pets/PetDisplay.kt @@ -55,7 +55,17 @@ class PetDisplay( private fun getLocation(player: Player): Location { val offset = player.eyeLocation.direction.clone().normalize() .multiply(-1) - .apply { y = abs(y) } + .apply { + y = abs(y) + + if (abs(x) < 0.5) { + x = 0.5 + } + + if (abs(z) < 0.5) { + z = 0.5 + } + } .rotateAroundY(PI / 6) return player.eyeLocation.clone().add(offset)