mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-02 16:59:35 +01:00
Fix flying pathfinder not setting yaw correctly
This commit is contained in:
parent
829cc1ef63
commit
214b113575
@ -1,5 +1,9 @@
|
||||
package net.citizensnpcs.npc.ai;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.ai.NavigatorParameters;
|
||||
import net.citizensnpcs.api.ai.TargetType;
|
||||
@ -16,10 +20,6 @@ import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||
private final NPC npc;
|
||||
private final NavigatorParameters parameters;
|
||||
@ -102,7 +102,9 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||
|
||||
NMS.setVerticalMovement(npc.getEntity(), 0.5);
|
||||
if (npc.getEntity().getType() != EntityType.ENDER_DRAGON) {
|
||||
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), current.getYaw() + normalisedTargetYaw);
|
||||
float newYaw = current.getYaw() + normalisedTargetYaw;
|
||||
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), newYaw);
|
||||
NMS.getHandle(npc.getEntity()).yaw = newYaw;
|
||||
}
|
||||
parameters.run();
|
||||
plan.run(npc);
|
||||
|
@ -1,5 +1,12 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderDragon;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -11,13 +18,6 @@ import net.minecraft.server.v1_8_R3.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import net.minecraft.server.v1_8_R3.World;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderDragon;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class EnderDragonController extends MobEntityController {
|
||||
public EnderDragonController() {
|
||||
super(EntityEnderDragonNPC.class);
|
||||
|
Loading…
Reference in New Issue
Block a user