Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Constants used throughout the code, useful typedefs and utility functions. More...
#include <ChunkDef.h>
Public Types | |
typedef EMCSBiome | BiomeMap[Width *Width] |
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need not correspond to client representation!) idx = x + Width * z. More... | |
typedef NIBBLETYPE | BlockNibbles[NumBlocks/2] |
The type used for block data in nibble format, AXIS_ORDER ordering. More... | |
typedef BLOCKTYPE | BlockTypes[NumBlocks] |
The type used for block type operations and storage, AXIS_ORDER ordering. More... | |
typedef HEIGHTTYPE | HeightMap[Width *Width] |
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column. More... | |
Static Public Member Functions | |
static void | AbsoluteToRelative (int &a_X, int &a_Y, int &a_Z, int &a_ChunkX, int &a_ChunkZ) |
Converts absolute block coords into relative (chunk + block) coords: More... | |
static Vector3i | AbsoluteToRelative (Vector3i a_BlockPosition) |
Converts the specified absolute position into a relative position within its chunk. More... | |
static Vector3i | AbsoluteToRelative (Vector3i a_BlockPosition, cChunkCoords a_ChunkPos) |
Converts the absolute coords into coords relative to the specified chunk. More... | |
static cChunkCoords | BlockToChunk (const Vector3i a_Position) |
The Y coordinate of a_Pos is ignored. More... | |
static void | BlockToChunk (int a_X, int a_Z, int &a_ChunkX, int &a_ChunkZ) |
Converts absolute block coords to chunk coords: More... | |
static NIBBLETYPE | ExpandNibble (const NIBBLETYPE *const a_Buffer, const size_t a_Index) |
static EMCSBiome | GetBiome (const BiomeMap &a_BiomeMap, int a_X, int a_Z) |
static BLOCKTYPE | GetBlock (const BLOCKTYPE *a_BlockTypes, int a_Idx) |
static BLOCKTYPE | GetBlock (const BLOCKTYPE *a_BlockTypes, int a_X, int a_Y, int a_Z) |
static BLOCKTYPE | GetBlock (const BLOCKTYPE *a_BlockTypes, Vector3i a_RelPos) |
static HEIGHTTYPE | GetHeight (const HeightMap &a_HeightMap, int a_X, int a_Z) |
static NIBBLETYPE | GetNibble (const NIBBLETYPE *a_Buffer, int x, int y, int z) |
static Vector3i | IndexToCoordinate (size_t index) |
static bool | IsValidHeight (Vector3i a_BlockPosition) |
Validates a height-coordinate. More... | |
static bool | IsValidRelPos (Vector3i a_RelPos) |
Validates a chunk relative coordinate. More... | |
static bool | IsValidWidth (int a_Width) |
Validates a width-coordinate. More... | |
static size_t | MakeIndex (int x, int y, int z) |
static size_t | MakeIndex (Vector3i a_RelPos) |
static void | PackNibble (NIBBLETYPE *const a_Buffer, const size_t a_Index, const NIBBLETYPE a_Nibble) |
static Vector3i | RelativeToAbsolute (Vector3i a_RelBlockPosition, cChunkCoords a_ChunkCoords) |
Converts relative block coordinates into absolute coordinates with a known chunk location. More... | |
static void | SetBiome (BiomeMap &a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome) |
static void | SetBlock (BLOCKTYPE *a_BlockTypes, int a_Index, BLOCKTYPE a_Type) |
static void | SetBlock (BLOCKTYPE *a_BlockTypes, int a_X, int a_Y, int a_Z, BLOCKTYPE a_Type) |
static void | SetHeight (HeightMap &a_HeightMap, int a_X, int a_Z, HEIGHTTYPE a_Height) |
Static Public Attributes | |
static const int | Height = 256 |
static const int | NumBlocks = Width * Height * Width |
static const size_t | NumSections = (cChunkDef::Height / SectionHeight) |
static const int | SectionHeight = 16 |
static const int | Width = 16 |
Constants used throughout the code, useful typedefs and utility functions.
Definition at line 102 of file ChunkDef.h.
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need not correspond to client representation!) idx = x + Width * z.
Definition at line 120 of file ChunkDef.h.
typedef NIBBLETYPE cChunkDef::BlockNibbles[NumBlocks/2] |
The type used for block data in nibble format, AXIS_ORDER ordering.
Definition at line 126 of file ChunkDef.h.
The type used for block type operations and storage, AXIS_ORDER ordering.
Definition at line 123 of file ChunkDef.h.
typedef HEIGHTTYPE cChunkDef::HeightMap[Width *Width] |
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column.
Definition at line 115 of file ChunkDef.h.
|
inlinestatic |
Converts absolute block coords into relative (chunk + block) coords:
Definition at line 130 of file ChunkDef.h.
Converts the specified absolute position into a relative position within its chunk.
Use BlockToChunk to query the chunk coords.
Definition at line 142 of file ChunkDef.h.
|
inlinestatic |
Converts the absolute coords into coords relative to the specified chunk.
Definition at line 150 of file ChunkDef.h.
|
inlinestatic |
The Y coordinate of a_Pos is ignored.
Definition at line 204 of file ChunkDef.h.
|
inlinestatic |
Converts absolute block coords to chunk coords:
Definition at line 193 of file ChunkDef.h.
|
inlinestatic |
Definition at line 340 of file ChunkDef.h.
Definition at line 302 of file ChunkDef.h.
Definition at line 279 of file ChunkDef.h.
|
inlinestatic |
Definition at line 270 of file ChunkDef.h.
|
inlinestatic |
Definition at line 263 of file ChunkDef.h.
|
inlinestatic |
Definition at line 286 of file ChunkDef.h.
|
inlinestatic |
Definition at line 318 of file ChunkDef.h.
|
inlinestatic |
Definition at line 229 of file ChunkDef.h.
|
inlinestatic |
Validates a height-coordinate.
Returns false if height-coordinate is out of height bounds
Definition at line 168 of file ChunkDef.h.
|
inlinestatic |
Validates a chunk relative coordinate.
Returns false if the coordiante is out of bounds for a chunk.
Definition at line 182 of file ChunkDef.h.
|
inlinestatic |
Validates a width-coordinate.
Returns false if width-coordiante is out of width bounds
Definition at line 175 of file ChunkDef.h.
|
inlinestatic |
Definition at line 210 of file ChunkDef.h.
|
inlinestatic |
Definition at line 223 of file ChunkDef.h.
|
inlinestatic |
Definition at line 329 of file ChunkDef.h.
|
inlinestatic |
Converts relative block coordinates into absolute coordinates with a known chunk location.
Definition at line 157 of file ChunkDef.h.
|
inlinestatic |
Definition at line 310 of file ChunkDef.h.
|
inlinestatic |
Definition at line 256 of file ChunkDef.h.
|
inlinestatic |
Definition at line 247 of file ChunkDef.h.
|
inlinestatic |
Definition at line 294 of file ChunkDef.h.
|
static |
Definition at line 108 of file ChunkDef.h.
Definition at line 109 of file ChunkDef.h.
|
static |
Definition at line 112 of file ChunkDef.h.
|
static |
Definition at line 111 of file ChunkDef.h.
|
static |
Definition at line 107 of file ChunkDef.h.