Add elytra effect to flying pathfinder

This commit is contained in:
fullwall 2018-06-29 22:50:48 +08:00
parent aef2c48256
commit 283fd3ee32
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,8 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
motX += (Math.signum(d0) * 0.5D - motX) * 0.1;
motY += (Math.signum(d1) - motY) * 0.1;
motZ += (Math.signum(d2) * 0.5D - motZ) * 0.1;
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F;
float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360;
if (normalisedTargetYaw >= 180.0F) {