mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 17:31:06 +01:00
Fixed the NaN check in Entity.java
This commit is contained in:
parent
70eb283bd0
commit
f34f41a471
1 changed files with 2 additions and 2 deletions
|
@ -146,7 +146,7 @@ public abstract class Entity {
|
||||||
|
|
||||||
protected void c(float f, float f1) {
|
protected void c(float f, float f1) {
|
||||||
// Craftbukkit start
|
// Craftbukkit start
|
||||||
if ((f == Float.POSITIVE_INFINITY) || (f == Float.NEGATIVE_INFINITY) || (f == Float.NaN)) {
|
if ((f == Float.POSITIVE_INFINITY) || (f == Float.NEGATIVE_INFINITY) || (Float.isNaN(f))) {
|
||||||
if (this instanceof EntityPlayer) {
|
if (this instanceof EntityPlayer) {
|
||||||
System.err.println(getBukkitEntity() + " was caught trying to crash the server with an invalid yaw");
|
System.err.println(getBukkitEntity() + " was caught trying to crash the server with an invalid yaw");
|
||||||
((CraftPlayer)this.getBukkitEntity()).kickPlayer("Nope");
|
((CraftPlayer)this.getBukkitEntity()).kickPlayer("Nope");
|
||||||
|
@ -154,7 +154,7 @@ public abstract class Entity {
|
||||||
f = 0;
|
f = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((f1 == Float.POSITIVE_INFINITY) || (f1 == Float.NEGATIVE_INFINITY) || (f1 == Float.NaN)) {
|
if ((f1 == Float.POSITIVE_INFINITY) || (f1 == Float.NEGATIVE_INFINITY) || (Float.isNaN(f1))) {
|
||||||
if (this instanceof EntityPlayer) {
|
if (this instanceof EntityPlayer) {
|
||||||
System.err.println(getBukkitEntity() + " was caught trying to crash the server with an invalid pitch");
|
System.err.println(getBukkitEntity() + " was caught trying to crash the server with an invalid pitch");
|
||||||
((CraftPlayer)this.getBukkitEntity()).kickPlayer("Nope");
|
((CraftPlayer)this.getBukkitEntity()).kickPlayer("Nope");
|
||||||
|
|
Loading…
Reference in a new issue