Fix gravity, half-fix look close bug

This commit is contained in:
fullwall 2019-04-26 17:53:53 +08:00
parent 3d893d81d0
commit e4717d4bc7
2 changed files with 3 additions and 4 deletions

View File

@ -418,7 +418,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
updatePackets(navigating); updatePackets(navigating);
if (!navigating && getBukkitEntity() != null && npc.getTrait(Gravity.class).hasGravity() if (!navigating && getBukkitEntity() != null && npc.getTrait(Gravity.class).hasGravity()
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) { && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) {
a(0, 0, 0); e(new Vec3D(0, 0, 0));
} }
Vec3D mot = getMot(); Vec3D mot = getMot();
if (Math.abs(mot.getX()) < EPSILON && Math.abs(mot.getY()) < EPSILON && Math.abs(mot.getZ()) < EPSILON) { if (Math.abs(mot.getX()) < EPSILON && Math.abs(mot.getY()) < EPSILON && Math.abs(mot.getZ()) < EPSILON) {

View File

@ -23,16 +23,15 @@ public class PlayerControllerLook {
if (!NMSImpl.isNavigationFinished(this.a.getNavigation())) if (!NMSImpl.isNavigationFinished(this.a.getNavigation()))
return; return;
if (this.b()) { if (this.b()) {
this.a.pitch = 0.0F; // this.a.pitch = 0.0F;
} }
if (this.d) { if (this.d) {
this.d = false; this.d = false;
this.a.aM = this.a(this.a.aM, this.h(), this.b); this.a.aM = this.a(this.a.aM, this.h(), this.b);
this.a.yaw = this.a.aM; this.a.yaw = this.a.aM;
this.a.pitch = this.a(this.a.pitch, this.g(), this.c); this.a.pitch = this.a(this.a.pitch, this.g(), this.c);
} else { } else {
this.a.aM = this.a(this.a.aM, this.a.aK, 10.0F); // this.a.aM = this.a(this.a.aM, this.a.aK, 10.0F);
} }
if (!this.a.getNavigation().n()) { if (!this.a.getNavigation().n()) {