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 119 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 137 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 143 of file ChunkDef.h.
The type used for block type operations and storage, AXIS_ORDER ordering.
Definition at line 140 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 132 of file ChunkDef.h.
|
inlinestatic |
Converts absolute block coords into relative (chunk + block) coords:
Definition at line 147 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 159 of file ChunkDef.h.
|
inlinestatic |
Converts the absolute coords into coords relative to the specified chunk.
Definition at line 167 of file ChunkDef.h.
|
inlinestatic |
The Y coordinate of a_Pos is ignored.
Definition at line 221 of file ChunkDef.h.
|
inlinestatic |
Converts absolute block coords to chunk coords:
Definition at line 210 of file ChunkDef.h.
|
inlinestatic |
Definition at line 357 of file ChunkDef.h.
Definition at line 319 of file ChunkDef.h.
Definition at line 296 of file ChunkDef.h.
|
inlinestatic |
Definition at line 287 of file ChunkDef.h.
|
inlinestatic |
Definition at line 280 of file ChunkDef.h.
|
inlinestatic |
Definition at line 303 of file ChunkDef.h.
|
inlinestatic |
Definition at line 335 of file ChunkDef.h.
|
inlinestatic |
Definition at line 246 of file ChunkDef.h.
|
inlinestatic |
Validates a height-coordinate.
Returns false if height-coordinate is out of height bounds
Definition at line 185 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 199 of file ChunkDef.h.
|
inlinestatic |
Validates a width-coordinate.
Returns false if width-coordiante is out of width bounds
Definition at line 192 of file ChunkDef.h.
|
inlinestatic |
Definition at line 227 of file ChunkDef.h.
|
inlinestatic |
Definition at line 240 of file ChunkDef.h.
|
inlinestatic |
Definition at line 346 of file ChunkDef.h.
|
inlinestatic |
Converts relative block coordinates into absolute coordinates with a known chunk location.
Definition at line 174 of file ChunkDef.h.
|
inlinestatic |
Definition at line 327 of file ChunkDef.h.
|
inlinestatic |
Definition at line 273 of file ChunkDef.h.
|
inlinestatic |
Definition at line 264 of file ChunkDef.h.
|
inlinestatic |
Definition at line 311 of file ChunkDef.h.
|
static |
Definition at line 125 of file ChunkDef.h.
Definition at line 126 of file ChunkDef.h.
|
static |
Definition at line 129 of file ChunkDef.h.
|
static |
Definition at line 128 of file ChunkDef.h.
|
static |
Definition at line 124 of file ChunkDef.h.