MCPcopy Create free account
hub / github.com/cuberite/cuberite / GetTreeImageByBiome

Function GetTreeImageByBiome

src/Generating/Trees.cpp:153–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, EMCSBiome a_Biome, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
154{
155 switch (a_Biome)
156 {
157 case biPlains:
158 case biExtremeHills:
159 case biExtremeHillsEdge:
160 case biForest:
161 case biMushroomIsland:
162 case biMushroomShore:
163 case biForestHills:
164 case biDeepOcean:
165 case biStoneBeach:
166 case biColdBeach:
167 {
168 // Apple or birch trees:
169 if (a_Noise.IntNoise3DInt(a_BlockX, a_BlockY + 16 * a_Seq, a_BlockZ + 16 * a_Seq) < 0x5fffffff)
170 {
171 GetAppleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
172 }
173 else
174 {
175 GetBirchTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
176 }
177 break;
178 }
179
180 case biTaiga:
181 case biIcePlains:
182 case biIceMountains:
183 case biTaigaHills:
184 {
185 // Conifers
186 GetConiferTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
187 break;
188 }
189
190 case biSwampland:
191 {
192 // Swamp trees:
193 GetSwampTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
194 break;
195 }
196
197 case biJungle:
198 case biJungleHills:
199 case biJungleEdge:
200 {
201 // Apple bushes, large jungle trees, small jungle trees
202 if (a_Noise.IntNoise3DInt(a_BlockX, a_BlockY + 16 * a_Seq, a_BlockZ + 16 * a_Seq) < 0x6fffffff)
203 {
204 GetAppleBushImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
205 }
206 else
207 {
208 GetJungleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
209 }
210 break;

Callers 2

GrowTreeByBiomeMethod · 0.85
GenerateSingleTreeMethod · 0.85

Calls 8

GetAppleTreeImageFunction · 0.85
GetBirchTreeImageFunction · 0.85
GetConiferTreeImageFunction · 0.85
GetSwampTreeImageFunction · 0.85
GetAppleBushImageFunction · 0.85
GetJungleTreeImageFunction · 0.85
GetTallBirchTreeImageFunction · 0.85
IntNoise3DIntMethod · 0.80

Tested by

no test coverage detected