mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-05 02:10:10 +01:00
Increase y velocity for flyable NPCs
This commit is contained in:
parent
c02fec9ca0
commit
eb5ca54807
@ -540,7 +540,7 @@ public class NPCCommands {
|
|||||||
npc.setFlyable(flyable);
|
npc.setFlyable(flyable);
|
||||||
flyable = npc.isFlyable(); // may not have applied, eg bats always
|
flyable = npc.isFlyable(); // may not have applied, eg bats always
|
||||||
// flyable
|
// flyable
|
||||||
Messaging.sendTr(sender, flyable ? Messages.FLYABLE_SET : Messages.FLYABLE_UNSET);
|
Messaging.sendTr(sender, flyable ? Messages.FLYABLE_SET : Messages.FLYABLE_UNSET, npc.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
@ -121,7 +121,7 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
|||||||
double motX = velocity.getX(), motY = velocity.getY(), motZ = velocity.getZ();
|
double motX = velocity.getX(), motY = velocity.getY(), motZ = velocity.getZ();
|
||||||
|
|
||||||
motX += (Math.signum(d0) * 0.5D - motX) * 0.1;
|
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;
|
motZ += (Math.signum(d2) * 0.5D - motZ) * 0.1;
|
||||||
float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F;
|
float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F;
|
||||||
float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360;
|
float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360;
|
||||||
@ -131,7 +131,6 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
|||||||
if (normalisedTargetYaw < -180.0F) {
|
if (normalisedTargetYaw < -180.0F) {
|
||||||
normalisedTargetYaw += 360.0F;
|
normalisedTargetYaw += 360.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
|
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
|
||||||
npc.getEntity().setVelocity(velocity);
|
npc.getEntity().setVelocity(velocity);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user