This commit is contained in:
fullwall 2012-10-31 14:46:24 +08:00
parent 43e218be05
commit 0c2a689793
3 changed files with 10 additions and 3 deletions

View File

@ -34,8 +34,9 @@ public class CitizensHumanNPC extends CitizensNPC implements Equipable {
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
handle.yaw = loc.getYaw();
NMS.setHeadYaw(handle, loc.getYaw() % 360);
// set the head yaw in another tick - if done immediately,
// set the yaw in another tick - if done immediately,
// minecraft will not update it.
boolean removeFromPlayerList = Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean();
NMS.addOrRemoveFromPlayerList(getBukkitEntity(),

View File

@ -129,12 +129,13 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
super.j_();
if (npc == null)
return;
updateEquipment();
NMS.updateAI(this);
Navigation navigation = getNavigation();
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON)
motX = motY = motZ = 0;
NMS.updateSenses(this);
if (!navigation.f()) {
navigation.e();
moveOnCurrentHeading();
@ -148,6 +149,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
private void moveOnCurrentHeading() {
NMS.updateAI(this);
// taken from EntityLiving update method
if (bG) {
/* boolean inLiquid = H() || J();

View File

@ -282,7 +282,7 @@ public class NMS {
}
public static void updateAI(EntityLiving entity) {
entity.az().a();
updateSenses(entity);
entity.getNavigation().e();
entity.getControllerMove().c();
entity.getControllerLook().a();
@ -354,4 +354,8 @@ public class NMS {
STAIR_MATERIALS.add(material.getId());
}
}
public static void updateSenses(EntityLiving entity) {
entity.az().a();
}
}