use of org.bukkit.craftbukkit.v1_17_R1.entity.CraftEnderDragon in project UltraCosmetics by iSach.
the class EntityUtil method moveDragon.
@Override
public void moveDragon(Player player, Vector vector, org.bukkit.entity.Entity entity) {
EnderDragon ec = ((CraftEnderDragon) entity).getHandle();
ec.hurtTime = -1;
ec.setXRot(player.getLocation().getPitch());
ec.setYRot(player.getLocation().getYaw() - 180);
float yaw = player.getPlayer().getLocation().getYaw();
double angleInRadians = toRadians(-yaw);
double x = sin(angleInRadians);
double z = cos(angleInRadians);
Vector v = ec.getBukkitEntity().getLocation().getDirection();
ec.move(MoverType.SELF, new Vec3(x, v.getY(), z));
}
use of org.bukkit.craftbukkit.v1_17_R1.entity.CraftEnderDragon in project UltraCosmetics by iSach.
the class EntityUtil method moveDragon.
@Override
public void moveDragon(Player player, Vector vector, org.bukkit.entity.Entity entity) {
EnderDragon ec = ((CraftEnderDragon) entity).getHandle();
ec.hurtTime = -1;
ec.setXRot(player.getLocation().getPitch());
ec.setYRot(player.getLocation().getYaw() - 180);
float yaw = player.getPlayer().getLocation().getYaw();
double angleInRadians = toRadians(-yaw);
double x = sin(angleInRadians);
double z = cos(angleInRadians);
Vector v = ec.getBukkitEntity().getLocation().getDirection();
ec.move(MoverType.SELF, new Vec3(x, v.getY(), z));
}
Aggregations