Units of Measurement: Difference between revisions

From wiki.vg
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>HOLOGRAPHICpizza
mNo edit summary
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
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.
A block represents 1 meter x 1 meter x 1 meter. There are 32 pixels per meter, and chunks are 16m x 256m x 16m.


{| class="wikitable"
{| class="wikitable"
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 13:09, 21 April 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 256m 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.