Cuberite
A lightweight, fast and extensible game server for Minecraft
Macros | Functions
Trees.h File Reference
#include "../Noise/Noise.h"
#include "../ChunkDef.h"
Include dependency graph for Trees.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CASE_TREE_ALLOWED_BLOCKS
 
#define CASE_TREE_OVERWRITTEN_BLOCKS
 

Functions

void GetAcaciaTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random acacia tree. More...
 
void GetAppleBushImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random apple bush (for jungles) More...
 
void GetAppleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random apple tree. More...
 
void GetBirchTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random birch tree. More...
 
void GetBrownMushroomTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks with the blocks required to form the brown mushroom. More...
 
void GetConiferTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks, bool a_Large=false)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random conifer tree. More...
 
void GetDarkoakTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random darkoak tree. More...
 
void GetJungleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks, bool a_Large)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random jungle tree. More...
 
void GetLargeAppleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a large (branching) apple tree. More...
 
void GetLargeJungleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a large jungle tree (2x2 trunk) More...
 
void GetLargePineTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large pine (tall conifer, little leaves at top) More...
 
void GetLargeSpruceTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large spruce (short conifer, multiple layers of leaves) More...
 
NIBBLETYPE GetLogMetaFromDirection (NIBBLETYPE a_BlockMeta, Vector3d a_Direction)
 Returns the meta for a log from the given direction. More...
 
void GetPineTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks, bool a_Large=false)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random pine. More...
 
void GetRedMushroomTreeImage (Vector3i vector3, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks with the blocks required to form the red mushroom. More...
 
void GetSmallAppleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a small (nonbranching) apple tree. More...
 
void GetSmallJungleTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a small jungle tree (1x1 trunk) More...
 
void GetSmallPineTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random small pine (tall conifer, little leaves at top) More...
 
void GetSmallSpruceTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random small spruce (short conifer, two layers of leaves) More...
 
void GetSpruceTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks, bool a_Large=false)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random spruce. More...
 
void GetSwampTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random swampland tree. More...
 
void GetTallBirchTreeImage (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large birch tree. More...
 
Vector3d GetTreeBranch (BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_BlockPos, int a_BranchLength, Vector3d a_StartDirection, Vector3d a_Direction, sSetBlockVector &a_LogBlocks)
 Fills a_LogBlocks with the logs of a tree branch of the provided log type. More...
 
void GetTreeImageByBiome (Vector3i a_BlockPos, cNoise &a_Noise, int a_Seq, EMCSBiome a_Biome, sSetBlockVector &a_LogBlocks, sSetBlockVector &a_OtherBlocks)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a tree at the specified coords (lowest trunk block) in the specified biome. More...
 

Macro Definition Documentation

◆ CASE_TREE_ALLOWED_BLOCKS

#define CASE_TREE_ALLOWED_BLOCKS
Value:
case E_BLOCK_AIR: \
case E_BLOCK_SNOW: \
@ E_BLOCK_NEW_LEAVES
Definition: BlockType.h:180
@ E_BLOCK_DEAD_BUSH
Definition: BlockType.h:42
@ E_BLOCK_AIR
Definition: BlockType.h:10
@ E_BLOCK_LEAVES
Definition: BlockType.h:28
@ E_BLOCK_SNOW
Definition: BlockType.h:92
@ E_BLOCK_VINES
Definition: BlockType.h:121
@ E_BLOCK_SAPLING
Definition: BlockType.h:16
@ E_BLOCK_TALL_GRASS
Definition: BlockType.h:41

Definition at line 27 of file Trees.h.

◆ CASE_TREE_OVERWRITTEN_BLOCKS

#define CASE_TREE_OVERWRITTEN_BLOCKS
Value:
case E_BLOCK_AIR: \
/* case E_BLOCK_LEAVES: LEAVES are a special case, they can be overwritten only by log. Handled in cChunkMap::ReplaceTreeBlocks(). */ \
case E_BLOCK_SNOW: \
@ E_BLOCK_BIG_FLOWER
Definition: BlockType.h:194

Definition at line 38 of file Trees.h.

Function Documentation

◆ GetAcaciaTreeImage()

void GetAcaciaTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random acacia tree.

Definition at line 711 of file Trees.cpp.

◆ GetAppleBushImage()

void GetAppleBushImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random apple bush (for jungles)

Definition at line 1267 of file Trees.cpp.

◆ GetAppleTreeImage()

void GetAppleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random apple tree.

Definition at line 522 of file Trees.cpp.

◆ GetBirchTreeImage()

void GetBirchTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random birch tree.

Definition at line 673 of file Trees.cpp.

◆ GetBrownMushroomTreeImage()

void GetBrownMushroomTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks with the blocks required to form the brown mushroom.

Definition at line 1492 of file Trees.cpp.

◆ GetConiferTreeImage()

void GetConiferTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks,
bool  a_Large = false 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random conifer tree.

The probability to get a large pine is higher than a spruce tree

Definition at line 878 of file Trees.cpp.

◆ GetDarkoakTreeImage()

void GetDarkoakTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random darkoak tree.

Definition at line 769 of file Trees.cpp.

◆ GetJungleTreeImage()

void GetJungleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks,
bool  a_Large 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random jungle tree.

Definition at line 1287 of file Trees.cpp.

◆ GetLargeAppleTreeImage()

void GetLargeAppleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a large (branching) apple tree.

Definition at line 590 of file Trees.cpp.

◆ GetLargeJungleTreeImage()

void GetLargeJungleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a large jungle tree (2x2 trunk)

Definition at line 1303 of file Trees.cpp.

◆ GetLargePineTreeImage()

void GetLargePineTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large pine (tall conifer, little leaves at top)

Definition at line 1184 of file Trees.cpp.

◆ GetLargeSpruceTreeImage()

void GetLargeSpruceTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large spruce (short conifer, multiple layers of leaves)

Definition at line 1040 of file Trees.cpp.

◆ GetLogMetaFromDirection()

NIBBLETYPE GetLogMetaFromDirection ( NIBBLETYPE  a_BlockMeta,
Vector3d  a_Direction 
)

Returns the meta for a log from the given direction.

Definition at line 651 of file Trees.cpp.

◆ GetPineTreeImage()

void GetPineTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks,
bool  a_Large = false 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random pine.

Definition at line 912 of file Trees.cpp.

◆ GetRedMushroomTreeImage()

void GetRedMushroomTreeImage ( Vector3i  vector3,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks with the blocks required to form the red mushroom.

Definition at line 1445 of file Trees.cpp.

◆ GetSmallAppleTreeImage()

void GetSmallAppleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a small (nonbranching) apple tree.

Definition at line 538 of file Trees.cpp.

◆ GetSmallJungleTreeImage()

void GetSmallJungleTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a small jungle tree (1x1 trunk)

Definition at line 1388 of file Trees.cpp.

◆ GetSmallPineTreeImage()

void GetSmallPineTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random small pine (tall conifer, little leaves at top)

Definition at line 1131 of file Trees.cpp.

◆ GetSmallSpruceTreeImage()

void GetSmallSpruceTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random small spruce (short conifer, two layers of leaves)

Definition at line 929 of file Trees.cpp.

◆ GetSpruceTreeImage()

void GetSpruceTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks,
bool  a_Large = false 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random spruce.

Definition at line 895 of file Trees.cpp.

◆ GetSwampTreeImage()

void GetSwampTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random swampland tree.

Definition at line 1220 of file Trees.cpp.

◆ GetTallBirchTreeImage()

void GetTallBirchTreeImage ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random large birch tree.

Definition at line 840 of file Trees.cpp.

◆ GetTreeBranch()

Vector3d GetTreeBranch ( BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta,
Vector3i  a_BlockPos,
int  a_BranchLength,
Vector3d  a_StartDirection,
Vector3d  a_Direction,
sSetBlockVector a_LogBlocks 
)

Fills a_LogBlocks with the logs of a tree branch of the provided log type.

The length of the branch can be changed with the a_BranchLength. The initial direction is a_StartDirection. The direction can be manipulated with a_Direction to create a curve. Returns the position of the last log block placed.

Definition at line 633 of file Trees.cpp.

◆ GetTreeImageByBiome()

void GetTreeImageByBiome ( Vector3i  a_BlockPos,
cNoise a_Noise,
int  a_Seq,
EMCSBiome  a_Biome,
sSetBlockVector a_LogBlocks,
sSetBlockVector a_OtherBlocks 
)

Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a tree at the specified coords (lowest trunk block) in the specified biome.

Definition at line 310 of file Trees.cpp.