Too stingy with bits. Fix roundoff error in block click message.

This commit is contained in:
Justin Aquadro committed 2015-11-24 01:15:26 -05:00
1 parent f918c2886e
commit 3500a4632e
1 file changed
+6 -6
@@ -39,9 +39,9 @@ public class BlockClickMessage implements IMessage
y = buf.readShort();
z = buf.readInt();
side = buf.readByte();
hitX = buf.readByte() / 16f;
hitY = buf.readByte() / 16f;
hitZ = buf.readByte() / 16f;
hitX = buf.readFloat();
hitY = buf.readFloat();
hitZ = buf.readFloat();
invertShift = buf.readBoolean();
}
@@ -51,9 +51,9 @@ public class BlockClickMessage implements IMessage
buf.writeShort(y);
buf.writeInt(z);
buf.writeByte(side);
buf.writeByte((int)(hitX * 16));
buf.writeByte((int)(hitY * 16));
buf.writeByte((int)(hitZ * 16));
buf.writeFloat(hitX);
buf.writeFloat(hitY);
buf.writeFloat(hitZ);
buf.writeBoolean(invertShift);
}