Created
June 7, 2015 03:23
-
-
Save ItsSpyce/c409af480a327dedd243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var position = new Position(); | |
var val = connection.ReadLong(); | |
position.X = (int) (val >> 38); | |
if (position.X >= (2 ^ 25)) position.X -= 2 ^ 26; | |
position.Y = (int) ((val >> 26) & 0xFFF); | |
if (position.Y >= (2 ^ 11)) position.Y -= 2 ^ 12; | |
position.Z = (int) (val << 38 >> 38); | |
if (position.Z >= (2 ^ 25)) position.Z -= 2 ^ 26; | |
return position; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment