mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-29 06:05:17 +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) {
|
if (handle instanceof EntityInsentient) {
|
||||||
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
||||||
to.getPitch());
|
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) {
|
} else if (handle instanceof EntityHumanNPC) {
|
||||||
((EntityHumanNPC) handle).setTargetLook(to);
|
((EntityHumanNPC) handle).setTargetLook(to);
|
||||||
}
|
}
|
||||||
|
@ -108,11 +108,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void A_() {
|
public void A_() {
|
||||||
livingEntityBaseTick();
|
|
||||||
super.A_();
|
super.A_();
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
livingEntityBaseTick();
|
||||||
|
|
||||||
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
||||||
updateEffects = true;
|
updateEffects = true;
|
||||||
}
|
}
|
||||||
|
@ -644,6 +644,13 @@ public class NMSImpl implements NMSBridge {
|
|||||||
if (handle instanceof EntityInsentient) {
|
if (handle instanceof EntityInsentient) {
|
||||||
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(), to.getYaw(),
|
||||||
to.getPitch());
|
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) {
|
} else if (handle instanceof EntityHumanNPC) {
|
||||||
((EntityHumanNPC) handle).setTargetLook(to);
|
((EntityHumanNPC) handle).setTargetLook(to);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user