Commit graph

2 commits

Author SHA1 Message Date
Aikar 66733df5f9
add World#getLocationAtKey for Block Key API
For when you don't want to actually load the block
2018-08-19 11:50:40 -04:00
searchndstroy af57a5fed5 Allow Blocks to be accessed via a long key (#1335)
The key can be retrieved via methods Location#toBlockKey() and
Block#getBlockKey()

World provides lookup for blocks by long key via method World#getBlockAtKey(long)

The formatting for the key is as follows:

10 bit y|27 bit z|27 bit x

The y value is considered unsigned while z and x are considered two's complement

Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]


Checked encoding and decoding via https://gist.github.com/Spottedleaf/74f4e241012ca2fa67d8f1c7e8e34722
2018-08-17 17:55:01 -04:00