neoLegacy/Minecraft.World/ForestBiome.cpp
ChristianF 29523f5ba4 Rabbit follow Parents and Variants per biome
now rabbits in panic state are ok and doesnt jump far away. They spawn in a group 1 adult 1-2 baby
different weight spawn based on the biome, also they have correct variants per biome as far as i could check online
2026-03-13 19:09:15 +01:00

28 lines
1.1 KiB
C++

#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
friendlies.push_back(new MobSpawnerData(eTYPE_RABBIT, 4, 2, 3));
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
}