mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Test
This commit is contained in:
parent
43e218be05
commit
0c2a689793
@ -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(),
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user