mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed floating changelings. Closes #204
This commit is contained in:
parent
309e39b583
commit
4953e11c54
1 changed files with 11 additions and 4 deletions
|
@ -432,9 +432,14 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -522,7 +527,9 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
|
|||
@Override
|
||||
public Optional<BlockPos> 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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue