summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-04-24 20:14:33 -0400
committerEvilSeph <evilseph@unaligned.org>2011-04-24 20:16:01 -0400
commit0740e0c777fb692e0765e584e2cbc020b8f75db2 (patch)
treeec6276f2e62e1d262d63627178645d11e0178a6f /src/main/java/net
parentd156fcf9c8f5b3d76afff66e5cdfe20e618d38af (diff)
downloadcraftbukkit-0740e0c777fb692e0765e584e2cbc020b8f75db2.tar
craftbukkit-0740e0c777fb692e0765e584e2cbc020b8f75db2.tar.gz
craftbukkit-0740e0c777fb692e0765e584e2cbc020b8f75db2.tar.lz
craftbukkit-0740e0c777fb692e0765e584e2cbc020b8f75db2.tar.xz
craftbukkit-0740e0c777fb692e0765e584e2cbc020b8f75db2.zip
Fixes the whitescreen issue some people were having.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/Entity.java12
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java9
2 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f9d9482d..53b237a9 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -852,6 +852,18 @@ public abstract class Entity {
public void d(NBTTagCompound nbttagcompound) {
nbttagcompound.a("Pos", (NBTBase) this.a(new double[] { this.locX, this.locY, this.locZ}));
nbttagcompound.a("Motion", (NBTBase) this.a(new double[] { this.motX, this.motY, this.motZ}));
+
+ // CraftBukkit start - checking for NaN pitch/yaw and resetting to zero
+ // TODO: make sure this is the best way to address this.
+ if (Float.isNaN(this.yaw)) {
+ this.yaw = 0;
+ }
+
+ if (Float.isNaN(this.pitch)) {
+ this.pitch = 0;
+ }
+ // CraftBukkit end
+
nbttagcompound.a("Rotation", (NBTBase) this.a(new float[] { this.yaw, this.pitch}));
nbttagcompound.a("FallDistance", this.fallDistance);
nbttagcompound.a("Fire", (short) this.fireTicks);
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index b9888ef6..747c0548 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -356,6 +356,15 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
d2 = to.getZ();
f = to.getYaw();
f1 = to.getPitch();
+
+ // TODO: make sure this is the best way to address this.
+ if (Float.isNaN(f)) {
+ f = 0;
+ }
+
+ if (Float.isNaN(f1)) {
+ f1 = 0;
+ }
// CraftBukkit end
this.m = false;