From 7219e74c7ca47013fb5fe99707f38ae7417257af Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 7 Mar 2012 22:09:55 +0000 Subject: Anvil format: loading chests' contents. git-svn-id: http://mc-server.googlecode.com/svn/trunk@385 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/WSSAnvil.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/WSSAnvil.h') diff --git a/source/WSSAnvil.h b/source/WSSAnvil.h index f02a30119..1052d0e5a 100644 --- a/source/WSSAnvil.h +++ b/source/WSSAnvil.h @@ -26,6 +26,8 @@ enum // fwd: "NBT.h" class cNBTTag; +class cNBTList; +class cNBTCompound; @@ -81,6 +83,17 @@ protected: /// Loads the chunk from NBT data (no locking needed) bool LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT); + /// Loads the chunk's entities from NBT data (a_NBT is the Level\\Entities list tag; may be NULL) + void LoadEntitiesFromNBT(cEntityList & a_Entitites, const cNBTList * a_NBT); + + /// Loads the chunk's BlockEntities from NBT data (a_NBT is the Level\\TileEntities list tag; may be NULL) + void LoadBlockEntitiesFromNBT(cBlockEntityList & a_BlockEntitites, const cNBTList * a_NBT); + + void LoadChestFromNBT(cBlockEntityList & a_BlockEntities, const cNBTCompound * a_NBT); + + /// Helper function for extracting the X, Y, and Z int subtags of a NBT compound; returns true if successful + bool GetBlockEntityNBTPos(const cNBTCompound * a_NBT, int & a_X, int & a_Y, int & a_Z); + /// Gets the correct MCA file either from cache or from disk, manages the m_MCAFiles cache; assumes m_CS is locked cMCAFile * LoadMCAFile(const cChunkCoords & a_Chunk); -- cgit v1.2.3