Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <ChunkInterface.h>
Public Member Functions | |
cChunkInterface (cChunkMap *a_ChunkMap) | |
bool | DigBlock (cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, cEntity *a_Digger) |
bool | DoWithChunkAt (Vector3i a_BlockPos, cFunctionRef< bool(cChunk &)> a_Callback) |
void | DropBlockAsPickups (Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr) |
Digs the block and spawns the relevant pickups, as if a_Digger used a_Tool to dig the block. More... | |
void | FastSetBlock (Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) |
Sets the block at the specified coords to the specified value. More... | |
virtual bool | ForEachChunkInRect (int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback &a_Callback) override |
Calls the callback for each chunk in the specified range. More... | |
BLOCKTYPE | GetBlock (Vector3i a_Pos) |
NIBBLETYPE | GetBlockMeta (Vector3i a_Pos) |
bool | GetBlockTypeMeta (Vector3i a_Pos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) |
void | SetBlock (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) |
OBSOLETE, use the Vector3i-based overload instead. More... | |
void | SetBlock (Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) |
Sets the block at the specified coords to the specified value. More... | |
void | SetBlockMeta (int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_MetaData) |
OBSOLETE, Use the Vector3-based overload instead. More... | |
void | SetBlockMeta (Vector3i a_BlockPos, NIBBLETYPE a_MetaData) |
Sets the meta for the specified block, while keeping the blocktype. More... | |
bool | UseBlockEntity (cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) |
Use block entity on coordinate. More... | |
virtual bool | WriteBlockArea (cBlockArea &a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) override |
Writes the block area into the specified coords. More... | |
Public Member Functions inherited from cForEachChunkProvider | |
virtual | ~cForEachChunkProvider () |
Private Attributes | |
cChunkMap * | m_ChunkMap |
Definition at line 21 of file ChunkInterface.h.
|
inline |
Definition at line 26 of file ChunkInterface.h.
bool cChunkInterface::DigBlock | ( | cWorldInterface & | a_WorldInterface, |
Vector3i | a_BlockPos, | ||
cEntity * | a_Digger | ||
) |
Definition at line 104 of file ChunkInterface.cpp.
bool cChunkInterface::DoWithChunkAt | ( | Vector3i | a_BlockPos, |
cFunctionRef< bool(cChunk &)> | a_Callback | ||
) |
Definition at line 14 of file ChunkInterface.cpp.
void cChunkInterface::DropBlockAsPickups | ( | Vector3i | a_BlockPos, |
const cEntity * | a_Digger = nullptr , |
||
const cItem * | a_Tool = nullptr |
||
) |
Digs the block and spawns the relevant pickups, as if a_Digger used a_Tool to dig the block.
Definition at line 123 of file ChunkInterface.cpp.
void cChunkInterface::FastSetBlock | ( | Vector3i | a_BlockPos, |
BLOCKTYPE | a_BlockType, | ||
NIBBLETYPE | a_BlockMeta | ||
) |
Sets the block at the specified coords to the specified value.
The replacement doesn't trigger block updates. The replaced blocks aren't checked for block entities (block entity is leaked if it exists at this block).
Definition at line 68 of file ChunkInterface.cpp.
|
overridevirtual |
Calls the callback for each chunk in the specified range.
Implements cForEachChunkProvider.
Definition at line 86 of file ChunkInterface.cpp.
Definition at line 23 of file ChunkInterface.cpp.
NIBBLETYPE cChunkInterface::GetBlockMeta | ( | Vector3i | a_Pos | ) |
Definition at line 32 of file ChunkInterface.cpp.
bool cChunkInterface::GetBlockTypeMeta | ( | Vector3i | a_Pos, |
BLOCKTYPE & | a_BlockType, | ||
NIBBLETYPE & | a_BlockMeta | ||
) |
Definition at line 41 of file ChunkInterface.cpp.
|
inline |
OBSOLETE, use the Vector3i-based overload instead.
Sets the block at the specified coords to the specified value. Full processing, incl. updating neighbors, is performed.
Definition at line 42 of file ChunkInterface.h.
void cChunkInterface::SetBlock | ( | Vector3i | a_BlockPos, |
BLOCKTYPE | a_BlockType, | ||
NIBBLETYPE | a_BlockMeta | ||
) |
Sets the block at the specified coords to the specified value.
Full processing, incl. updating neighbors, is performed.
Definition at line 50 of file ChunkInterface.cpp.
|
inline |
OBSOLETE, Use the Vector3-based overload instead.
Sets the meta for the specified block, while keeping the blocktype. Ignored if the chunk is invalid.
Definition at line 54 of file ChunkInterface.h.
void cChunkInterface::SetBlockMeta | ( | Vector3i | a_BlockPos, |
NIBBLETYPE | a_MetaData | ||
) |
Sets the meta for the specified block, while keeping the blocktype.
Ignored if the chunk is invalid.
Definition at line 59 of file ChunkInterface.cpp.
bool cChunkInterface::UseBlockEntity | ( | cPlayer * | a_Player, |
int | a_BlockX, | ||
int | a_BlockY, | ||
int | a_BlockZ | ||
) |
Use block entity on coordinate.
returns true if the use was successful, return false to use the block as a "normal" block
Definition at line 77 of file ChunkInterface.cpp.
|
overridevirtual |
Writes the block area into the specified coords.
Returns true if all chunks have been processed. a_DataTypes is a bitmask of cBlockArea::baXXX constants ORed together.
Implements cForEachChunkProvider.
Definition at line 95 of file ChunkInterface.cpp.
|
private |
Definition at line 79 of file ChunkInterface.h.