feat(gameplay): spawn creatures during chunk generation

Add creature spawning to chunk generation with a configurable
SpawnConfig, including a default pig spawn. Spawning occurs in
the final generation phase and registers entities through the
server world's entity manager.

Also destroy entities when their chunk is unloaded to prevent
orphaned entities and expose the entity manager from ServerWorld.
This commit is contained in:
2026-08-05 16:56:02 +08:00
parent 322fb2fea0
commit 8ff789c576
8 changed files with 62 additions and 4 deletions

View File

@@ -50,6 +50,8 @@ public:
void generate_cave();
void generate_river();
void spawn_creature();
private:
static inline std::atomic<bool> is_init{false};
static inline unsigned m_generator_seed{0};