From 427fc7d210a3a8b9b338e4b3ad73fc633072785b Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 11 Oct 2023 14:17:12 +0100 Subject: [PATCH] Fixed floating changelings. Closes #204 --- .../unicopia/entity/player/Pony.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index d9a2a20b..cd956d63 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -420,9 +420,14 @@ public class Pony extends Living implements Copyable, Update entity.setVelocity(entity.getVelocity().multiply(1, 0, 1)); entity.setSneaking(false); } - } else if (attachDirection != null && isFaceClimbable(entity.getWorld(), entity.getBlockPos(), attachDirection)) { - entity.setBodyYaw(attachDirection.asRotation()); - entity.prevBodyYaw = attachDirection.asRotation(); + } else if (attachDirection != null) { + if (isFaceClimbable(entity.getWorld(), entity.getBlockPos(), attachDirection)) { + entity.setBodyYaw(attachDirection.asRotation()); + entity.prevBodyYaw = attachDirection.asRotation(); + } else { + entity.setVelocity(vel); + entity.isClimbing(); + } } } @@ -480,7 +485,9 @@ public class Pony extends Living implements Copyable, Update @Override public Optional chooseClimbingPos() { if (getObservedSpecies() == Race.CHANGELING && getSpellSlot().get(SpellPredicate.IS_DISGUISE, false).isEmpty()) { - return Optional.of(entity.getBlockPos()); + if (isFaceClimbable(entity.getWorld(), entity.getBlockPos(), entity.getHorizontalFacing()) || canHangAt(entity.getBlockPos())) { + return Optional.of(entity.getBlockPos()); + } } return super.chooseClimbingPos(); }