Difference between revisions of "Units of Measurement"

From wiki.vg
Jump to navigation Jump to search
Line 32: Line 32:
  
 
[[Category:Protocol Details]]
 
[[Category:Protocol Details]]
[[Category:Minecraft Beta]]
+
[[Category:Minecraft Modern]]

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.