Cuberite
A lightweight, fast and extensible game server for Minecraft
|
A modifier which is pseudo-randomly replacing blocks to other types and metas. More...
Public Member Functions | |
virtual void | AssignSeed (int a_Seed) override |
Called when the piece pool is assigned to a generator, so that the modifiers can access world seed. More... | |
cPieceModifierRandomizeBlocks (void) | |
virtual bool | InitializeFromString (const AString &a_Params, bool a_LogWarnings) override |
Initializes the modifier's parameters from the string representation. More... | |
virtual void | Modify (cBlockArea &a_Image, const Vector3i a_PiecePos, const int a_PieceRot) override |
Called prior to writing piece to a chunk, so that modifiers can modify blocks in the blockarea. More... | |
bool | ParseMeta (const AString &a_Meta, std::array< int, 4 > &a_ParsedMeta, bool a_LogWarnings) |
Public Member Functions inherited from cPiece::cPieceModifier | |
virtual | ~cPieceModifier () |
Protected Attributes | |
int | m_AllWeights = 0 |
cRandomizedBlocks | m_BlocksToRandomize |
Randomized blocks with their weights and meta params. More... | |
std::map< BLOCKTYPE, int > | m_BlocksToReplace |
Block types of a blocks which are being replaced by this strategy. More... | |
int | m_MaxMeta = -1 |
Maximum meta to randomize. More... | |
int | m_MaxNoiseMeta = 0 |
Maximum meta in noise range. More... | |
int | m_MinMeta = 0 |
Minimum meta to randomize. More... | |
int | m_MinNoiseMeta = 0 |
Minimum meta in noise range. More... | |
int | m_Seed |
A modifier which is pseudo-randomly replacing blocks to other types and metas.
Definition at line 21 of file PieceModifier.cpp.
|
inline |
Definition at line 25 of file PieceModifier.cpp.
|
inlineoverridevirtual |
Called when the piece pool is assigned to a generator, so that the modifiers can access world seed.
Reimplemented from cPiece::cPieceModifier.
Definition at line 280 of file PieceModifier.cpp.
|
inlineoverridevirtual |
Initializes the modifier's parameters from the string representation.
a_Params is the string containing only the parameters If a_LogWarnings is true, logs any problems to the console. Returns true if successful, false if the string parsing failed. Used when loading the modifier from a file.
BlocksToReplace parsing
Meta params parsing
Implements cPiece::cPieceModifier.
Definition at line 30 of file PieceModifier.cpp.
|
inlineoverridevirtual |
Called prior to writing piece to a chunk, so that modifiers can modify blocks in the blockarea.
Implements cPiece::cPieceModifier.
Definition at line 227 of file PieceModifier.cpp.
|
inline |
Definition at line 181 of file PieceModifier.cpp.
|
protected |
Definition at line 286 of file PieceModifier.cpp.
|
protected |
Randomized blocks with their weights and meta params.
Definition at line 293 of file PieceModifier.cpp.
|
protected |
Block types of a blocks which are being replaced by this strategy.
Definition at line 290 of file PieceModifier.cpp.
|
protected |
Maximum meta to randomize.
Definition at line 299 of file PieceModifier.cpp.
|
protected |
Maximum meta in noise range.
Definition at line 302 of file PieceModifier.cpp.
|
protected |
Minimum meta to randomize.
Definition at line 296 of file PieceModifier.cpp.
|
protected |
Minimum meta in noise range.
Definition at line 305 of file PieceModifier.cpp.
|
protected |
Definition at line 285 of file PieceModifier.cpp.