Units of Measurement: Difference between revisions
Jump to navigation
Jump to search
imported>SirCmpwn Created page with "There are several different units of measurement used in the protocol depending on what is being described. For example, it wouldn't make much sense to send the position of a ..." |
imported>SirCmpwn No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 30: | Line 30: | ||
| class="col3" | Represents the position of a chunk. | | class="col3" | Represents the position of a chunk. | ||
|} | |} | ||
[[Category:Protocol Details]] | |||
[[Category:Minecraft Modern]] |
Latest revision as of 12:35, 29 March 2012
There are several different units of measurement used in the protocol depending on what is being described. For example, it wouldn't make much sense to send the position of a block (which is a constant multiple of 32) in a floating point double.
A block represents 1 meter x 1 meter x 1 meter. There are 32 pixels per meter, and chunks are 16m x 128m x 16m.
Data Types | Units | Represents | |
---|---|---|---|
Absolute | double | meters | Represents an object's location in the world. |
Absolute Integer | int | pixels | Represents an object's location in the world. Functions the same as Absolute Double, but requires fewer bytes and is less precise. In C/C++/Java: absolute_int = (int)(absolute_double * 32.0);
|
Block | byte, short, int | meters | Represents a block's location in the world. |
Chunk | short, int | chunks | Represents the position of a chunk. |