mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 20:21:19 +01:00
Ender dragon shouldn't get its yaw set while flying
This commit is contained in:
parent
e035ffde04
commit
b8242e2db5
@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_7_R4.MathHelper;
|
import net.minecraft.server.v1_7_R4.MathHelper;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||||
@ -95,11 +96,13 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
|||||||
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 = MathHelper.g(targetYaw - current.getYaw());
|
float normalisedTargetYaw = MathHelper.g(targetYaw - current.getYaw());
|
||||||
|
|
||||||
velocity.setX(motX).setY(motY).setZ(motZ);
|
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
|
||||||
npc.getEntity().setVelocity(velocity);
|
npc.getEntity().setVelocity(velocity);
|
||||||
|
|
||||||
NMS.setVerticalMovement(npc.getEntity(), 0.5);
|
NMS.setVerticalMovement(npc.getEntity(), 0.5);
|
||||||
|
if (npc.getEntity().getType() != EntityType.ENDER_DRAGON) {
|
||||||
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), current.getYaw() + normalisedTargetYaw);
|
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), current.getYaw() + normalisedTargetYaw);
|
||||||
|
}
|
||||||
parameters.run();
|
parameters.run();
|
||||||
plan.run(npc);
|
plan.run(npc);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user