Increase y velocity for flyable NPCs

This commit is contained in:
fullwall 2017-06-09 20:31:43 +08:00
parent c02fec9ca0
commit eb5ca54807
2 changed files with 2 additions and 3 deletions

View File

@ -540,7 +540,7 @@ public class NPCCommands {
npc.setFlyable(flyable);
flyable = npc.isFlyable(); // may not have applied, eg bats always
// flyable
Messaging.sendTr(sender, flyable ? Messages.FLYABLE_SET : Messages.FLYABLE_UNSET);
Messaging.sendTr(sender, flyable ? Messages.FLYABLE_SET : Messages.FLYABLE_UNSET, npc.getName());
}
@Command(

View File

@ -121,7 +121,7 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
double motX = velocity.getX(), motY = velocity.getY(), motZ = velocity.getZ();
motX += (Math.signum(d0) * 0.5D - motX) * 0.1;
motY += (Math.signum(d1) * 0.7D - motY) * 0.1;
motY += (Math.signum(d1) - motY) * 0.1;
motZ += (Math.signum(d2) * 0.5D - motZ) * 0.1;
float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F;
float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360;
@ -131,7 +131,6 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
if (normalisedTargetYaw < -180.0F) {
normalisedTargetYaw += 360.0F;
}
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
npc.getEntity().setVelocity(velocity);