Stop large look changes from crashing the server
Co-authored-by: Jaren Knodel <Jaren@Knodel.com>
This commit is contained in:
@@ -163,3 +163,19 @@
|
||||
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
|
||||
}
|
||||
}
|
||||
@@ -333,14 +413,8 @@
|
||||
}
|
||||
|
||||
protected static float lerpRotation(float prevRot, float newRot) {
|
||||
- while (newRot - prevRot < -180.0F) {
|
||||
- prevRot -= 360.0F;
|
||||
- }
|
||||
+ prevRot += Math.round((newRot - prevRot) / 360.0F) * 360.0F; // Paper - stop large look changes from crashing the server
|
||||
|
||||
- while (newRot - prevRot >= 180.0F) {
|
||||
- prevRot += 360.0F;
|
||||
- }
|
||||
-
|
||||
return Mth.lerp(0.2F, prevRot, newRot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user