mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Clamp controller look yaw for entityinsentients as well
This commit is contained in:
parent
974cb61a43
commit
d968384d58
@ -612,6 +612,12 @@ public class NMSImpl implements NMSBridge {
|
||||
if (handle instanceof EntityInsentient) {
|
||||
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
||||
to.getPitch());
|
||||
while (((EntityInsentient) handle).aO >= 180F) {
|
||||
((EntityInsentient) handle).aO -= 360F;
|
||||
}
|
||||
while (((EntityInsentient) handle).aO < -180F) {
|
||||
((EntityInsentient) handle).aO += 360F;
|
||||
}
|
||||
} else if (handle instanceof EntityHumanNPC) {
|
||||
((EntityHumanNPC) handle).setTargetLook(to);
|
||||
}
|
||||
|
@ -108,11 +108,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
livingEntityBaseTick();
|
||||
super.A_();
|
||||
if (npc == null)
|
||||
return;
|
||||
|
||||
livingEntityBaseTick();
|
||||
|
||||
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
||||
updateEffects = true;
|
||||
}
|
||||
|
@ -644,6 +644,13 @@ public class NMSImpl implements NMSBridge {
|
||||
if (handle instanceof EntityInsentient) {
|
||||
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
||||
to.getPitch());
|
||||
|
||||
while (((EntityInsentient) handle).aP >= 180F) {
|
||||
((EntityInsentient) handle).aP -= 360F;
|
||||
}
|
||||
while (((EntityInsentient) handle).aP < -180F) {
|
||||
((EntityInsentient) handle).aP += 360F;
|
||||
}
|
||||
} else if (handle instanceof EntityHumanNPC) {
|
||||
((EntityHumanNPC) handle).setTargetLook(to);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user