Files
MinecraftConsoles/Minecraft.World/StructureStart.h

44 lines
987 B
C
Raw Normal View History

2026-03-01 12:16:08 +08:00
#pragma once
class StructurePiece;
class BoundingBox;
2026-03-01 11:00:23 -06:00
#include "StructureFeatureIO.h"
2026-03-01 12:16:08 +08:00
class StructureStart
{
2026-03-01 11:00:23 -06:00
public:
list<StructurePiece *> pieces;
2026-03-01 12:16:08 +08:00
protected:
2026-03-01 11:00:23 -06:00
BoundingBox *boundingBox;
private:
int chunkX, chunkZ;
2026-03-01 12:16:08 +08:00
public:
2026-03-01 11:00:23 -06:00
StructureStart();
StructureStart(int x, int z);
2026-03-01 12:16:08 +08:00
~StructureStart();
BoundingBox *getBoundingBox();
2026-03-01 11:00:23 -06:00
list<StructurePiece *> *getPieces();
void postProcess(Level *level, Random *random, BoundingBox *chunkBB);
2026-03-01 12:16:08 +08:00
protected:
void calculateBoundingBox();
2026-03-01 11:00:23 -06:00
public:
virtual CompoundTag *createTag(int chunkX, int chunkZ);
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void load(Level *level, CompoundTag *tag);
virtual void readAdditonalSaveData(CompoundTag *tag);
protected:
void moveBelowSeaLevel(Level *level, Random *random, int offset);
2026-03-01 12:16:08 +08:00
void moveInsideHeights(Level *level, Random *random, int lowestAllowed, int highestAllowed);
public:
bool isValid();
2026-03-01 11:00:23 -06:00
int getChunkX();
int getChunkZ();
2026-03-01 12:16:08 +08:00
2026-03-01 11:00:23 -06:00
virtual EStructureStart GetType() = 0;
2026-03-01 12:16:08 +08:00
};