Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Functions | Variables
Trees.cpp File Reference
#include "Globals.h"
#include "Trees.h"
Include dependency graph for Trees.cpp:

Go to the source code of this file.

Classes

struct  sCoords
 
struct  sCoordsArr
 
struct  sMetaCoords
 

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 GetConiferTreeImage (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 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...
 
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)
 Fills a_LogBlocks and a_OtherBlocks (dirt & leaves) with the blocks required to form a random pine (tall conifer, little leaves at top) 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 GetSpruceTreeImage (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 spruce (short conifer, two layers of leaves) 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...
 
static const Vector3dpickBranchDirection (const cNoise a_Noise, Vector3i a_BlockPos, int a_Seq)
 Chooses a direction for a branch to go to based on the start position (a_BlockPos) and a_Seq. More...
 
void PushCoordBlocks (int a_BlockX, int a_Height, int a_BlockZ, sSetBlockVector &a_Blocks, const sCoords *a_Coords, size_t a_NumCoords, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
 Pushes a specified layer of blocks of the same type around (x, h, z) into a_Blocks. More...
 
void PushCornerBlocks (int a_BlockX, int a_Height, int a_BlockZ, int a_Seq, cNoise &a_Noise, int a_Chance, sSetBlockVector &a_Blocks, int a_CornersDist, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
 
void PushSomeColumns (int a_BlockX, int a_Height, int a_BlockZ, int a_ColumnHeight, int a_Seq, cNoise &a_Noise, int a_Chance, sSetBlockVector &a_Blocks, const sMetaCoords *a_Coords, size_t a_NumCoords, BLOCKTYPE a_BlockType)
 

Variables

static const sCoords BigO1 []
 
static const sCoords BigO2 []
 
static const sCoords BigO3 []
 
static const sCoords BigO3Jungle []
 
static const sCoords BigO4 []
 
static const sCoords BigO4Jungle []
 
static const sCoords BigO5Jungle []
 
static const sCoordsArr BigOJungleLayers []
 
static const sCoordsArr BigOLayers []
 
static const sCoords Corners []
 

Function Documentation

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 567 of file Trees.cpp.

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 948 of file Trees.cpp.

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 378 of file Trees.cpp.

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 529 of file Trees.cpp.

void GetConiferTreeImage ( 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 conifer tree.

Definition at line 734 of file Trees.cpp.

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 625 of file Trees.cpp.

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 968 of file Trees.cpp.

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 446 of file Trees.cpp.

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 984 of file Trees.cpp.

NIBBLETYPE GetLogMetaFromDirection ( NIBBLETYPE  a_BlockMeta,
Vector3d  a_Direction 
)

Returns the meta for a log from the given direction.

Definition at line 507 of file Trees.cpp.

void GetPineTreeImage ( 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 pine (tall conifer, little leaves at top)

Definition at line 848 of file Trees.cpp.

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 394 of file Trees.cpp.

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 1054 of file Trees.cpp.

void GetSpruceTreeImage ( 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 spruce (short conifer, two layers of leaves)

Definition at line 751 of file Trees.cpp.

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 901 of file Trees.cpp.

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 696 of file Trees.cpp.

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 489 of file Trees.cpp.

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 227 of file Trees.cpp.

static const Vector3d& pickBranchDirection ( const cNoise  a_Noise,
Vector3i  a_BlockPos,
int  a_Seq 
)
static

Chooses a direction for a branch to go to based on the start position (a_BlockPos) and a_Seq.

Definition at line 33 of file Trees.cpp.

void PushCoordBlocks ( int  a_BlockX,
int  a_Height,
int  a_BlockZ,
sSetBlockVector a_Blocks,
const sCoords a_Coords,
size_t  a_NumCoords,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_Meta 
)
inline

Pushes a specified layer of blocks of the same type around (x, h, z) into a_Blocks.

Definition at line 178 of file Trees.cpp.

void PushCornerBlocks ( int  a_BlockX,
int  a_Height,
int  a_BlockZ,
int  a_Seq,
cNoise a_Noise,
int  a_Chance,
sSetBlockVector a_Blocks,
int  a_CornersDist,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_Meta 
)
inline

Definition at line 190 of file Trees.cpp.

void PushSomeColumns ( int  a_BlockX,
int  a_Height,
int  a_BlockZ,
int  a_ColumnHeight,
int  a_Seq,
cNoise a_Noise,
int  a_Chance,
sSetBlockVector a_Blocks,
const sMetaCoords a_Coords,
size_t  a_NumCoords,
BLOCKTYPE  a_BlockType 
)
inline

Definition at line 207 of file Trees.cpp.

Variable Documentation

const sCoords BigO1[]
static
Initial value:
=
{
{0, -1},
{-1, 0}, {1, 0},
{0, 1},
}

Definition at line 66 of file Trees.cpp.

const sCoords BigO2[]
static
Initial value:
=
{
{-1, -2}, {0, -2}, {1, -2},
{-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1},
{-2, 0}, {-1, 0}, {1, 0}, {2, 0},
{-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1},
{-1, 2}, {0, 2}, {1, 2},
}

Definition at line 73 of file Trees.cpp.

const sCoords BigO3[]
static
Initial value:
=
{
{-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3},
{-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2},
{-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1},
{-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0},
{-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1},
{-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2},
{-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3},
}

Definition at line 82 of file Trees.cpp.

const sCoords BigO3Jungle[]
static
Initial value:
=
{
{0, -3}, {1, -3},
{-1, -2}, {0, -2}, {1, -2}, {2, -2},
{-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1},
{-3, 0}, {-2, 0}, {-1, 0}, {0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0},
{-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1},
{-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2},
{-1, 3}, {0, 3}, {1, 3}, {2, 3},
{0, 4}, {1, 4},
}

Definition at line 107 of file Trees.cpp.

const sCoords BigO4[]
static
Initial value:
=
{
{-2, -4}, {-1, -4}, {0, -4}, {1, -4}, {2, -4},
{-3, -3}, {-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3}, {3, -3},
{-4, -2}, {-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2}, {4, -2},
{-4, -1}, {-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, {4, -1},
{-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0},
{-4, 1}, {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1},
{-4, 2}, {-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2},
{-3, 3}, {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3}, {3, 3},
{-2, 4}, {-1, 4}, {0, 4}, {1, 4}, {2, 4},
}

Definition at line 94 of file Trees.cpp.

const sCoords BigO4Jungle[]
static
Initial value:
=
{
{0, -4}, {1, -4},
{-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3}, {3, -3},
{-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2}, {4, -2},
{-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, {4, -1},
{-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0},
{-4, 1}, {-3, 1}, {-2, 1}, {-1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1},
{-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2},
{-3, 3}, {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3},
{-2, 4}, {-1, 4}, {0, 4}, {1, 4}, {2, 4}, {3, 4},
{0, 5}, {1, 5},
}

Definition at line 119 of file Trees.cpp.

const sCoords BigO5Jungle[]
static
Initial value:
=
{
{0, -5}, {1, -5},
{-2, -4}, {-1, -4}, {0, -4}, {1, -4}, {2, -4}, {3, -4},
{-3, -3}, {-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3}, {3, -3}, {4, -3},
{-4, -2}, {-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2}, {4, -2}, {5, -2},
{-4, -1}, {-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, {4, -1}, {5, -1},
{-5, 0}, {-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0},
{-5, 1}, {-4, 1}, {-3, 1}, {-2, 1}, {-1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1},
{-4, 2}, {-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2},
{-4, 3}, {-3, 3}, {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3},
{-3, 4}, {-2, 4}, {-1, 4}, {0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4},
{-2, 5}, {-1, 5}, {0, 5}, {1, 5}, {2, 5}, {3, 5},
{0, 6}, {1, 6},
}

Definition at line 133 of file Trees.cpp.

const sCoordsArr BigOJungleLayers[]
static
Initial value:
=
{
}
static const sCoords BigO5Jungle[]
Definition: Trees.cpp:133
static const sCoords BigO3Jungle[]
Definition: Trees.cpp:107
static const sCoords BigO4Jungle[]
Definition: Trees.cpp:119
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Definition: Globals.h:290

Definition at line 167 of file Trees.cpp.

const sCoordsArr BigOLayers[]
static
Initial value:
=
{
}
static const sCoords BigO2[]
Definition: Trees.cpp:73
static const sCoords BigO3[]
Definition: Trees.cpp:82
static const sCoords BigO1[]
Definition: Trees.cpp:66
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Definition: Globals.h:290
static const sCoords BigO4[]
Definition: Trees.cpp:94

Definition at line 159 of file Trees.cpp.

const sCoords Corners[]
static
Initial value:
=
{
{-1, -1},
{-1, 1},
{1, -1},
{1, 1},
}

Definition at line 24 of file Trees.cpp.