flower forste part 1 + decompiled roofed forest

This commit is contained in:
Lord Cambion
2026-03-23 03:44:02 +01:00
parent 58d57f2b54
commit f0b06116c2
22 changed files with 901 additions and 630 deletions
+74 -16
View File
@@ -1,27 +1,85 @@
#include "stdafx.h"
#include "ForestBiome.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"
#include "DarkOakFeature.h"
ForestBiome::ForestBiome(int id) : Biome(id)
ForestBiome::ForestBiome(int id, int type) : Biome(id)
{
friendlies_wolf.push_back(new MobSpawnerData(eTYPE_WOLF, 5, 4, 4)); // 4J - moved to their own category
friendlies.push_back(new MobSpawnerData(eTYPE_RABBIT, 4, 2, 3));
decorator->treeCount = 10;
decorator->grassCount = 2;
this->biomeType = type;
this->setLeafColor(0x4EBA31);
this->setTemperatureAndDownfall(0.7f, 0.8f);
if (this->biomeType == 1) //flowerforest
{
this->decorator->treeCount = 10;
this->decorator->grassCount = 2;
this->decorator->flowerCount = 100;
this->decorator->alliumCount = 2;
this->decorator->azureBluetCount = 2;
this->decorator->oxeyeDaisyCount = 2;
this->decorator->blueOrchidCount = 0;
this->setTemperatureAndDownfall(0.6f, 0.6f);
}
else if (this->biomeType == 2) //birchforest
{
this->decorator->treeCount = 10;
this->decorator->grassCount = 2;
}
else if (this->biomeType == 3) //roofedforest
{
this->decorator->treeCount = 50;
this->decorator->grassCount = 2;
this->decorator->flowerCount = 1;
this->decorator->hugeMushrooms = 2;
}
else
{
this->decorator->treeCount = 6;
this->decorator->flowerCount = 4;
this->decorator->grassCount = 1;
MobSpawnerData* wolfSpawn = new MobSpawnerData(eTYPE_WOLF, 5, 4, 4);
this->friendlies.push_back(wolfSpawn);
}
if (this->biomeType == 0)
{
MobSpawnerData* rabbitSpawn = new MobSpawnerData(eTYPE_RABBIT, 4, 2, 3);
this->friendlies.push_back(rabbitSpawn);
}
}
Feature *ForestBiome::getTreeFeature(Random *random)
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 (this->biomeType == 3) // Roofed Forest
{
if (random->nextInt(3) > 0)
{
return new DarkOakFeature(false);
}
}
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
if (this->biomeType == 2 || random->nextInt(5) == 0)
{
return new BirchFeature(false, false);
}
return new TreeFeature(false); // 4J used to return member normalTree, now returning newly created object so that caller can be consistently resposible for cleanup
return new TreeFeature(false);
}
Biome* ForestBiome::setColor(int color, bool b)
{
Biome::setColor(color, b);
return this;
}