the whole game

This commit is contained in:
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

41
src/world/level/MobSpawner.h Executable file
View File

@@ -0,0 +1,41 @@
#ifndef NET_MINECRAFT_WORLD_LEVEL__MobSpawner_H__
#define NET_MINECRAFT_WORLD_LEVEL__MobSpawner_H__
//package net.minecraft.world.level;
#include <map>
#include <vector>
class Mob;
class Level;
class Biome;
class Random;
class MobCategory;
class TilePos;
class ChunkPos;
//
//@NOTE: This class is FINAL/sealed! (at least in java)
//
class MobSpawner
{
public:
static int tick(Level* level, bool spawnEnemies, bool spawnFriendlies);
static void postProcessSpawnMobs(Level* level, Biome* biome, int xo, int zo, int cellWidth, int cellHeight, Random* random);
static void finalizeMobSettings(Mob* mob, Level* level, float xx, float yy, float zz);
static bool isSpawnPositionOk(const MobCategory& category, Level* level, int x, int y, int z);
static TilePos getRandomPosWithin(Level* level, int xo, int zo);
static bool addMob(Level* level, Mob* mob, float x, float y, float z, float yRot, float xRot, bool force);
static void makeBabyMob(Mob* mob, float probability);
protected:
static const std::vector<int> bedEnemies;
private:
static const int MIN_SPAWN_DISTANCE = 24;
static std::map<ChunkPos, bool> chunksToPoll;
};
#endif /*NET_MINECRAFT_WORLD_LEVEL__MobSpawner_H__*/