Cuberite
A lightweight, fast and extensible game server for Minecraft
WSSAnvil.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../BlockEntities/BlockEntity.h"
4 #include "WorldStorage.h"
5 #include "FastNBT.h"
6 #include "StringCompression.h"
7 
8 
9 
10 
11 
12 // fwd:
13 class cItem;
14 class cItemGrid;
15 class cMonster;
16 class cProjectileEntity;
17 class cHangingEntity;
18 class cUUID;
19 class ChunkBlockData;
20 
21 
22 
23 
24 
26 class cWSSAnvil:
27  public cWSSchema
28 {
29  using Super = cWSSchema;
30 
31 public:
32 
33  cWSSAnvil(cWorld * a_World, int a_CompressionFactor);
34  virtual ~cWSSAnvil() override;
35 
36 protected:
37 
38  enum
39  {
41  MCA_MAX_CHUNKS = 32 * 32,
42 
45 
48  } ;
49 
50 
51  class cMCAFile
52  {
53  public:
54 
55  cMCAFile(cWSSAnvil & a_ParentSchema, const AString & a_FileName, int a_RegionX, int a_RegionZ);
56 
57  bool GetChunkData (const cChunkCoords & a_Chunk, ContiguousByteBuffer & a_Data);
58  bool SetChunkData (const cChunkCoords & a_Chunk, ContiguousByteBufferView a_Data);
59 
60  int GetRegionX () const {return m_RegionX; }
61  int GetRegionZ () const {return m_RegionZ; }
62  const AString & GetFileName() const {return m_FileName; }
63 
64  protected:
65 
67 
68  int m_RegionX;
69  int m_RegionZ;
72 
73  // The header, copied from the file so we don't have to seek to it all the time
74  // First 1024 entries are chunk locations - the 3 + 1 byte sector-offset and sector-count
76 
77  // Chunk timestamps, following the chunk headers
79 
81  unsigned FindFreeLocation(int a_LocalX, int a_LocalZ, size_t a_DataSize);
82 
84  bool OpenFile(bool a_IsForReading);
85  } ;
86 
89 
92  std::list<std::shared_ptr<cMCAFile>> m_Files;
93 
96 
98  void ChunkLoadFailed(const cChunkCoords a_ChunkCoords, const AString & a_Reason, ContiguousByteBufferView a_ChunkDataToSave);
99 
101  bool GetChunkData(const cChunkCoords & a_Chunk, ContiguousByteBuffer & a_Data);
102 
104  const std::byte * GetSectionData(const cParsedNBT & a_NBT, int a_Tag, const AString & a_ChildName, size_t a_Length);
105 
107  bool SetChunkData(const cChunkCoords & a_Chunk, ContiguousByteBufferView a_Data);
108 
110  bool LoadChunkFromData(const cChunkCoords & a_Chunk, ContiguousByteBufferView a_Data);
111 
114 
117  bool LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT & a_NBT, ContiguousByteBufferView a_RawChunkData);
118 
120  bool LoadBiomeMapFromNBT(cChunkDef::BiomeMap & a_BiomeMap, const cParsedNBT & a_NBT, int a_TagIdx);
121 
123  bool LoadHeightMapFromNBT(cChunkDef::HeightMap & a_HeightMap, const cParsedNBT & a_NBT, int a_TagIdx);
124 
126  void LoadEntitiesFromNBT(cEntityList & a_Entitites, const cParsedNBT & a_NBT, int a_Tag);
127 
129  void LoadBlockEntitiesFromNBT(cBlockEntities & a_BlockEntitites, const cParsedNBT & a_NBT, int a_Tag, const ChunkBlockData & a_BlockData);
130 
133  OwnedBlockEntity LoadBlockEntityFromNBT(const cParsedNBT & a_NBT, int a_Tag, Vector3i a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
134 
136  bool LoadItemFromNBT(cItem & a_Item, const cParsedNBT & a_NBT, int a_TagIdx);
137 
141  void LoadItemGridFromNBT(cItemGrid & a_ItemGrid, const cParsedNBT & a_NBT, int a_ItemsTagIdx, int s_SlotOffset = 0);
142 
146  AString DecodeSignLine(const AString & a_Line);
147 
151  bool CheckBlockEntityType(const cParsedNBT & a_NBT, int a_TagIdx, const AStringVector & a_ExpectedTypes, Vector3i a_Pos);
152 
153  OwnedBlockEntity LoadBannerFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
154  OwnedBlockEntity LoadBeaconFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
155  OwnedBlockEntity LoadBedFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
156  OwnedBlockEntity LoadBrewingstandFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
157  OwnedBlockEntity LoadChestFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
158  OwnedBlockEntity LoadCommandBlockFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
159  OwnedBlockEntity LoadDispenserFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
160  OwnedBlockEntity LoadDropperFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
161  OwnedBlockEntity LoadEnchantingTableFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
162  OwnedBlockEntity LoadEnderChestFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
163  OwnedBlockEntity LoadEndPortalFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
164  OwnedBlockEntity LoadFlowerPotFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
165  OwnedBlockEntity LoadFurnaceFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
166  OwnedBlockEntity LoadHopperFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
167  OwnedBlockEntity LoadJukeboxFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
168  OwnedBlockEntity LoadMobHeadFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
169  OwnedBlockEntity LoadMobSpawnerFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
170  OwnedBlockEntity LoadNoteBlockFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
171  OwnedBlockEntity LoadSignFromNBT (const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos);
172 
173  void LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_EntityTagIdx, std::string_view a_EntityName);
174 
175  void LoadBoatFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
176  void LoadEnderCrystalFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
177  void LoadFallingBlockFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
178  void LoadPickupFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
179  void LoadTNTFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
180  void LoadExpOrbFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
181  void LoadHangingFromNBT (cHangingEntity & a_Hanging, const cParsedNBT & a_NBT, int a_TagIdx);
182  void LoadItemFrameFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
183  void LoadLeashKnotFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
184  void LoadPaintingFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
185 
186  void LoadOldMinecartFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
187  void LoadMinecartRFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
188  void LoadMinecartCFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
189  void LoadMinecartFFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
190  void LoadMinecartTFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
191  void LoadMinecartHFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
192 
193  void LoadArrowFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
194  void LoadSplashPotionFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
195  void LoadSnowballFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
196  void LoadEggFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
197  void LoadFireballFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
198  void LoadFireChargeFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
199  void LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
200 
201  void LoadBatFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
202  void LoadBlazeFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
203  void LoadCatFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
204  void LoadCaveSpiderFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
205  void LoadChickenFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
206  void LoadCodFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
207  void LoadCowFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
208  void LoadCreeperFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
209  void LoadDolphinFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
210  void LoadDonkeyFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
211  void LoadDrownedFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
212  void LoadElderGuardianFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
213  void LoadEnderDragonFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
214  void LoadEndermanFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
215  void LoadEndermiteFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
216  void LoadEvokerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
217  void LoadFoxFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
218  void LoadGhastFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
219  void LoadGiantFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
220  void LoadGuardianFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
221  void LoadHorseFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
222  void LoadHoglinFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
223  void LoadHuskFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
224  void LoadIllusionerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
225  void LoadIronGolemFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
226  void LoadLlamaFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
227  void LoadMagmaCubeFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
228  void LoadMooshroomFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
229  void LoadMuleFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
230  void LoadOcelotFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
231  void LoadPandaFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
232  void LoadParrotFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
233  void LoadPhantomFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
234  void LoadPigFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
235  void LoadPiglinFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
236  void LoadPiglinBruteFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
237  void LoadPillagerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
238  void LoadPolarBearFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
239  void LoadPufferfishFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
240  void LoadRabbitFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
241  void LoadRavagerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
242  void LoadSalmonFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
243  void LoadSheepFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
244  void LoadShulkerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
245  void LoadSilverfishFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
246  void LoadSkeletonFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
247  void LoadSkeletonHorseFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
248  void LoadSlimeFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
249  void LoadSnowGolemFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
250  void LoadSpiderFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
251  void LoadSquidFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
252  void LoadStrayFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
253  void LoadStriderFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
254  void LoadTraderLlamaFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
255  void LoadTropicalFishFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
256  void LoadTurtleFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
257  void LoadVexFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
258  void LoadVillagerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
259  void LoadVindicatorFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
260  void LoadWanderingTraderFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
261  void LoadWitchFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
262  void LoadWitherFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
263  void LoadWitherSkeletonFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
264  void LoadWolfFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
265  void LoadZoglinFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
266  void LoadZombieFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
267  void LoadZombieHorseFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
268  void LoadZombifiedPiglinFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
269  void LoadZombieVillagerFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx);
270 
273  std::pair<AString, cUUID> LoadEntityOwner(const cParsedNBT & a_NBT, int a_TagIdx);
274 
276  bool LoadEntityBaseFromNBT(cEntity & a_Entity, const cParsedNBT & a_NBT, int a_TagIdx);
277 
279  bool LoadMonsterBaseFromNBT(cMonster & a_Monster, const cParsedNBT & a_NBT, int a_TagIdx);
280 
282  void LoadLeashToPosition(cMonster & a_Monster, const cParsedNBT & a_NBT, int a_TagIdx);
283 
285  bool LoadProjectileBaseFromNBT(cProjectileEntity & a_Entity, const cParsedNBT & a_NBT, int a_TagIx);
286 
288  bool LoadDoublesListFromNBT(double * a_Doubles, int a_NumDoubles, const cParsedNBT & a_NBT, int a_TagIdx);
289 
291  bool LoadFloatsListFromNBT(float * a_Floats, int a_NumFloats, const cParsedNBT & a_NBT, int a_TagIdx);
292 
294  bool GetBlockEntityNBTPos(const cParsedNBT & a_NBT, int a_TagIdx, Vector3i & a_AbsPos);
295 
297  std::shared_ptr<cMCAFile> LoadMCAFile(const cChunkCoords & a_Chunk);
298 
299  // cWSSchema overrides:
300  virtual bool LoadChunk(const cChunkCoords & a_Chunk) override;
301  virtual bool SaveChunk(const cChunkCoords & a_Chunk) override;
302  virtual const AString GetName() const override {return "anvil"; }
303 } ;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
std::vector< OwnedEntity > cEntityList
Definition: ChunkDef.h:33
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
std::basic_string_view< std::byte > ContiguousByteBufferView
Definition: Globals.h:376
std::basic_string< std::byte > ContiguousByteBuffer
Definition: Globals.h:375
std::vector< AString > AStringVector
Definition: StringUtils.h:12
std::string AString
Definition: StringUtils.h:11
Wraps the chunk coords into a single structure.
Definition: ChunkDef.h:57
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
Definition: ChunkDef.h:132
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Definition: ChunkDef.h:137
Definition: Entity.h:76
Definition: Item.h:37
Definition: File.h:38
Contains the result of a compression or extraction operation.
Contains routines for data compression.
Contains routines for data extraction.
Definition: UUID.h:11
Definition: World.h:53
Parses and contains the parsed data Also implements data accessor functions for tree traversal and va...
Definition: FastNBT.h:153
Implements the Anvil world storage schema.
Definition: WSSAnvil.h:28
bool SetChunkData(const cChunkCoords &a_Chunk, ContiguousByteBufferView a_Data)
Sets chunk data into the correct file; locks file CS as needed.
Definition: WSSAnvil.cpp:239
bool LoadMonsterBaseFromNBT(cMonster &a_Monster, const cParsedNBT &a_NBT, int a_TagIdx)
Loads monster common data from the NBT compound; returns true if successful.
Definition: WSSAnvil.cpp:3683
void LoadLeashKnotFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2078
void LoadSnowGolemFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3122
void LoadLeashToPosition(cMonster &a_Monster, const cParsedNBT &a_NBT, int a_TagIdx)
Loads the position to where is leashed the monster.
Definition: WSSAnvil.cpp:3740
void LoadMinecartRFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1831
void LoadMooshroomFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2726
void LoadPillagerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2887
void LoadThrownEnderpearlFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2278
virtual const AString GetName() const override
Definition: WSSAnvil.h:302
void LoadVindicatorFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3284
AString DecodeSignLine(const AString &a_Line)
Decodes the text contained within a sign.
Definition: WSSAnvil.cpp:807
virtual bool SaveChunk(const cChunkCoords &a_Chunk) override
Definition: WSSAnvil.cpp:149
OwnedBlockEntity LoadBedFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:959
void LoadLlamaFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2688
void LoadBlockEntitiesFromNBT(cBlockEntities &a_BlockEntitites, const cParsedNBT &a_NBT, int a_Tag, const ChunkBlockData &a_BlockData)
Loads the chunk's BlockEntities from NBT data (a_Tag is the Level\TileEntities list tag; may be -1)
Definition: WSSAnvil.cpp:566
void LoadTNTFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1962
void LoadZombieVillagerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3528
void LoadPigFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2836
void LoadArrowFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2119
void LoadSkeletonFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3051
bool CheckBlockEntityType(const cParsedNBT &a_NBT, int a_TagIdx, const AStringVector &a_ExpectedTypes, Vector3i a_Pos)
Returns true iff the "id" child tag inside the specified tag equals (case-sensitive) any of the speci...
Definition: WSSAnvil.cpp:836
const std::byte * GetSectionData(const cParsedNBT &a_NBT, int a_Tag, const AString &a_ChildName, size_t a_Length)
Copies a_Length bytes of data from the specified NBT Tag's Child into the a_Destination buffer.
Definition: WSSAnvil.cpp:4021
bool GetChunkData(const cChunkCoords &a_Chunk, ContiguousByteBuffer &a_Data)
Gets chunk data from the correct file; locks file CS as needed.
Definition: WSSAnvil.cpp:224
void LoadSilverfishFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3031
OwnedBlockEntity LoadEnderChestFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1175
Compression::Compressor m_Compressor
Definition: WSSAnvil.h:95
void LoadSalmonFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2967
void LoadHuskFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2650
void LoadCowFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2392
std::shared_ptr< cMCAFile > LoadMCAFile(const cChunkCoords &a_Chunk)
Gets the correct MCA file either from cache or from disk, manages the m_MCAFiles cache; assumes m_CS ...
Definition: WSSAnvil.cpp:254
void LoadMuleFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2746
void LoadHorseFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2595
void LoadMinecartFFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1877
OwnedBlockEntity LoadBlockEntityFromNBT(const cParsedNBT &a_NBT, int a_Tag, Vector3i a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Loads the data for a block entity from the specified NBT tag.
Definition: WSSAnvil.cpp:621
void LoadFallingBlockFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1806
void LoadMinecartHFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1911
void LoadDrownedFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2450
void LoadChickenFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2363
void LoadGiantFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2555
void LoadItemGridFromNBT(cItemGrid &a_ItemGrid, const cParsedNBT &a_NBT, int a_ItemsTagIdx, int s_SlotOffset=0)
Loads contentents of an Items[] list tag into a cItemGrid ItemGrid begins at the specified slot offse...
Definition: WSSAnvil.cpp:779
void LoadGuardianFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2575
void LoadDolphinFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2432
void LoadCreeperFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2412
void LoadBlazeFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2314
void LoadWanderingTraderFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3293
void LoadHoglinFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2641
OwnedBlockEntity LoadBeaconFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:916
void LoadTraderLlamaFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3200
void LoadZoglinFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3444
void LoadSkeletonHorseFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3084
bool GetBlockEntityNBTPos(const cParsedNBT &a_NBT, int a_TagIdx, Vector3i &a_AbsPos)
Helper function for extracting the X, Y, and Z int subtags of a NBT compound; returns true if success...
Definition: WSSAnvil.cpp:3846
OwnedBlockEntity LoadDropperFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1127
void LoadBatFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2294
void LoadEvokerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2517
void LoadPickupFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1928
void LoadWitherFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3322
void LoadShulkerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3022
void LoadPandaFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2809
bool LoadDoublesListFromNBT(double *a_Doubles, int a_NumDoubles, const cParsedNBT &a_NBT, int a_TagIdx)
Loads an array of doubles of the specified length from the specified NBT list tag a_TagIdx; returns t...
Definition: WSSAnvil.cpp:3810
void LoadWitchFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3302
bool LoadEntityBaseFromNBT(cEntity &a_Entity, const cParsedNBT &a_NBT, int a_TagIdx)
Loads entity common data from the NBT compound; returns true if successful.
Definition: WSSAnvil.cpp:3624
void LoadCodFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2383
OwnedBlockEntity LoadEnchantingTableFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1150
void LoadWolfFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3368
OwnedBlockEntity LoadCommandBlockFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1066
void LoadPolarBearFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2896
void LoadRavagerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2958
OwnedBlockEntity LoadNoteBlockFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1507
OwnedBlockEntity LoadMobSpawnerFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1349
void LoadStriderFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3191
void LoadExpOrbFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1984
void LoadZombieHorseFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3486
void LoadFoxFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2526
void LoadSheepFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2976
void LoadWitherSkeletonFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3348
void LoadCaveSpiderFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2343
void LoadHangingFromNBT(cHangingEntity &a_Hanging, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2013
void LoadZombifiedPiglinFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3495
std::pair< AString, cUUID > LoadEntityOwner(const cParsedNBT &a_NBT, int a_TagIdx)
Loads the owner name and UUID from the entity at the specified NBT tag.
Definition: WSSAnvil.cpp:3571
OwnedBlockEntity LoadFlowerPotFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1205
OwnedBlockEntity LoadBannerFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:885
OwnedBlockEntity LoadBrewingstandFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:984
void LoadItemFrameFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2041
void LoadEnderCrystalFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1760
virtual bool LoadChunk(const cChunkCoords &a_Chunk) override
Definition: WSSAnvil.cpp:133
OwnedBlockEntity LoadFurnaceFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1244
void LoadEggFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2230
void LoadEndermiteFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2508
Compression::Extractor m_Extractor
Definition: WSSAnvil.h:94
void LoadSquidFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3162
void LoadPiglinBruteFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2878
cCriticalSection m_CS
Protects m_Files against multithreaded access.
Definition: WSSAnvil.h:88
void LoadIllusionerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2659
void LoadMinecartCFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1845
Compression::Result SaveChunkToData(const cChunkCoords &a_Chunk)
Saves the chunk into datastream (no locking needed)
Definition: WSSAnvil.cpp:332
OwnedBlockEntity LoadMobHeadFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1433
void LoadSnowballFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2214
void LoadEndermanFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2488
void LoadBoatFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1740
OwnedBlockEntity LoadSignFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1529
void ChunkLoadFailed(const cChunkCoords a_ChunkCoords, const AString &a_Reason, ContiguousByteBufferView a_ChunkDataToSave)
Reports that the specified chunk failed to load and saves the chunk data to an external file.
Definition: WSSAnvil.cpp:173
std::list< std::shared_ptr< cMCAFile > > m_Files
A MRU cache of MCA files.
Definition: WSSAnvil.h:92
void LoadRabbitFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2914
void LoadTropicalFishFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3209
void LoadZombieFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3453
void LoadPaintingFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2096
bool LoadItemFromNBT(cItem &a_Item, const cParsedNBT &a_NBT, int a_TagIdx)
Loads a cItem contents from the specified NBT tag; returns true if successful.
Definition: WSSAnvil.cpp:673
OwnedBlockEntity LoadHopperFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1304
bool LoadProjectileBaseFromNBT(cProjectileEntity &a_Entity, const cParsedNBT &a_NBT, int a_TagIx)
Loads projectile common data from the NBT compound; returns true if successful.
Definition: WSSAnvil.cpp:3788
void LoadTurtleFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3218
void LoadMagmaCubeFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2697
void LoadDonkeyFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2441
OwnedBlockEntity LoadDispenserFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1104
bool LoadHeightMapFromNBT(cChunkDef::HeightMap &a_HeightMap, const cParsedNBT &a_NBT, int a_TagIdx)
Loads the chunk's height map into a_HeightMap if heights present and valid; returns false otherwise.
Definition: WSSAnvil.cpp:496
bool LoadBiomeMapFromNBT(cChunkDef::BiomeMap &a_BiomeMap, const cParsedNBT &a_NBT, int a_TagIdx)
Loads the chunk's biome map into a_BiomeMap if biomes present and valid; returns false otherwise.
Definition: WSSAnvil.cpp:466
bool LoadChunkFromData(const cChunkCoords &a_Chunk, ContiguousByteBufferView a_Data)
Loads the chunk from the data (no locking needed)
Definition: WSSAnvil.cpp:305
void LoadFireballFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2246
void LoadVillagerFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3236
void LoadParrotFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2818
void LoadVexFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3227
void LoadFireChargeFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2262
void LoadPufferfishFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2905
void LoadEntitiesFromNBT(cEntityList &a_Entitites, const cParsedNBT &a_NBT, int a_Tag)
Loads the chunk's entities from NBT data (a_Tag is the Level\Entities list tag; may be -1)
Definition: WSSAnvil.cpp:532
void LoadElderGuardianFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2459
cWSSchema Super
Definition: WSSAnvil.h:29
void LoadMinecartTFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1894
bool LoadChunkFromNBT(const cChunkCoords &a_Chunk, const cParsedNBT &a_NBT, ContiguousByteBufferView a_RawChunkData)
Loads the chunk from NBT data (no locking needed).
Definition: WSSAnvil.cpp:345
OwnedBlockEntity LoadChestFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1042
void LoadOcelotFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2755
void LoadGhastFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2535
@ MCA_MAX_CHUNKS
Maximum number of chunks in an MCA file - also the count of the header items.
Definition: WSSAnvil.h:41
@ MCA_HEADER_SIZE
The MCA header is 8 KiB.
Definition: WSSAnvil.h:44
@ MCA_CHUNK_HEADER_LENGTH
There are 5 bytes of header in front of each chunk.
Definition: WSSAnvil.h:47
void LoadSlimeFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3093
void LoadOldMinecartFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:1716
void LoadSplashPotionFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2190
cWSSAnvil(cWorld *a_World, int a_CompressionFactor)
Definition: WSSAnvil.cpp:83
void LoadEnderDragonFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2468
void LoadPhantomFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2827
OwnedBlockEntity LoadJukeboxFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1327
OwnedBlockEntity LoadEndPortalFromNBT(const cParsedNBT &a_NBT, int a_TagIdx, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos)
Definition: WSSAnvil.cpp:1190
virtual ~cWSSAnvil() override
Definition: WSSAnvil.cpp:123
void LoadStrayFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3182
void LoadSpiderFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:3142
void LoadPiglinFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2869
bool LoadFloatsListFromNBT(float *a_Floats, int a_NumFloats, const cParsedNBT &a_NBT, int a_TagIdx)
Loads an array of floats of the specified length from the specified NBT list tag a_TagIdx; returns tr...
Definition: WSSAnvil.cpp:3828
void LoadEntityFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_EntityTagIdx, std::string_view a_EntityName)
Definition: WSSAnvil.cpp:1571
void LoadIronGolemFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2668
void LoadCatFromNBT(cEntityList &a_Entities, const cParsedNBT &a_NBT, int a_TagIdx)
Definition: WSSAnvil.cpp:2334
bool OpenFile(bool a_IsForReading)
Opens a MCA file either for a Read operation (fails if doesn't exist) or for a Write operation (creat...
Definition: WSSAnvil.cpp:3890
int GetRegionZ() const
Definition: WSSAnvil.h:61
cWSSAnvil & m_ParentSchema
Definition: WSSAnvil.h:66
unsigned m_Header[MCA_MAX_CHUNKS]
Definition: WSSAnvil.h:75
unsigned m_TimeStamps[MCA_MAX_CHUNKS]
Definition: WSSAnvil.h:78
int GetRegionX() const
Definition: WSSAnvil.h:60
bool GetChunkData(const cChunkCoords &a_Chunk, ContiguousByteBuffer &a_Data)
Definition: WSSAnvil.cpp:3953
AString m_FileName
Definition: WSSAnvil.h:71
const AString & GetFileName() const
Definition: WSSAnvil.h:62
cMCAFile(cWSSAnvil &a_ParentSchema, const AString &a_FileName, int a_RegionX, int a_RegionZ)
Definition: WSSAnvil.cpp:3878
bool SetChunkData(const cChunkCoords &a_Chunk, ContiguousByteBufferView a_Data)
Definition: WSSAnvil.cpp:4035
unsigned FindFreeLocation(int a_LocalX, int a_LocalZ, size_t a_DataSize)
Finds a free location large enough to hold a_Data.
Definition: WSSAnvil.cpp:4123
std::unordered_map< size_t, OwnedBlockEntity > cBlockEntities
Definition: BlockEntity.h:17
std::unique_ptr< cBlockEntity > OwnedBlockEntity
Definition: BlockEntity.h:16