diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ForestBiome.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/ForestBiome.cpp')
| -rw-r--r-- | Minecraft.World/ForestBiome.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Minecraft.World/ForestBiome.cpp b/Minecraft.World/ForestBiome.cpp new file mode 100644 index 00000000..b22b8b39 --- /dev/null +++ b/Minecraft.World/ForestBiome.cpp @@ -0,0 +1,26 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.levelgen.feature.h" +#include "net.minecraft.world.level.biome.h" +#include "net.minecraft.world.entity.animal.h" +#include "net.minecraft.world.entity.h" +#include "ForestBiome.h" + +ForestBiome::ForestBiome(int id) : Biome(id) +{ + friendlies_wolf.push_back(new MobSpawnerData(eTYPE_WOLF, 5, 4, 4)); // 4J - moved to their own category + decorator->treeCount = 10; + decorator->grassCount = 2; +} + +Feature *ForestBiome::getTreeFeature(Random *random) +{ + if (random->nextInt(5) == 0) + { + return new BirchFeature(false); // 4J used to return member birchTree, now returning newly created object so that caller can be consistently resposible for cleanup + } + if (random->nextInt(10) == 0) + { + return new BasicTree(false); // 4J used to return member fancyTree, now returning newly created object so that caller can be consistently resposible for cleanup + } + return new TreeFeature(false); // 4J used to return member normalTree, now returning newly created object so that caller can be consistently resposible for cleanup +} |
