This repository has been archived on 2026-05-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MinecraftConsoles/Minecraft.World/VillageSiege.h
2026-03-01 12:16:08 +08:00

28 lines
502 B
C++

#pragma once
class VillageSiege
{
private:
Level *level;
bool hasSetupSiege;
int siegeState;
int siegeCount;
int nextSpawnTime;
weak_ptr<Village> village;
int spawnX, spawnY, spawnZ;
static const int SIEGE_NOT_INITED = -1;
static const int SIEGE_CAN_ACTIVATE = 0;
static const int SIEGE_TONIGHT = 1;
static const int SIEGE_DONE = 2;
public:
VillageSiege(Level *level);
void tick();
private:
bool tryToSetupSiege();
bool trySpawn();
Vec3 *findRandomSpawnPos(int x, int y, int z);
};