diff options
author | peterbell10 <peterbell10@live.co.uk> | 2020-04-03 23:23:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 23:23:38 +0200 |
commit | aac592f98598aae327d07b2a1bb155e33c6d51b1 (patch) | |
tree | 24f90211d753a7ec87585e919ef7c7acdfa49909 /src/BlockArea.h | |
parent | New hotfix to prevent calling OnBroken (#4600) (diff) | |
download | cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.gz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.bz2 cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.lz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.xz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.zst cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockArea.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/BlockArea.h b/src/BlockArea.h index 9c0cb4ec9..f9dd388c0 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -19,6 +19,7 @@ #include "ChunkDataCallback.h" #include "Cuboid.h" #include "FunctionRef.h" +#include "BlockEntities/BlockEntity.h" @@ -456,6 +457,7 @@ protected: using NIBBLEARRAY = std::unique_ptr<NIBBLETYPE[]>; using BLOCKARRAY = std::unique_ptr<BLOCKTYPE[]>; + using cBlockEntitiesPtr = std::unique_ptr<cBlockEntities>; Vector3i m_Origin; Vector3i m_Size; @@ -469,14 +471,6 @@ protected: NIBBLEARRAY m_BlockLight; // Each light value is stored as a separate byte for faster access NIBBLEARRAY m_BlockSkyLight; // Each light value is stored as a separate byte for faster access - /** Deleter to clear the block entities before deleting the container. */ - struct sBlockEntitiesDeleter - { - void operator () (cBlockEntities * a_BlockEntities); - }; - - using cBlockEntitiesPtr = std::unique_ptr<cBlockEntities, sBlockEntitiesDeleter>; - /** The block entities contained within the area. Only valid if the area was created / read with the baBlockEntities flag. The block entities are owned by this object. */ @@ -512,9 +506,6 @@ protected: template <bool MetasValid> void MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_RelY, int a_RelZ, eMergeStrategy a_Strategy, const NIBBLETYPE * SrcMetas, NIBBLETYPE * DstMetas); - /** Clears the block entities from the specified container, freeing each blockentity. */ - static void ClearBlockEntities(cBlockEntities & a_BlockEntities); - /** Updates m_BlockEntities to remove BEs that no longer match the blocktype at their coords, and clones from a_Src the BEs that are missing. a_RelX, a_RelY and a_RelZ are relative coords that should be added to all BEs from a_Src before checking them. If a block should have a BE but one cannot be found in either this or a_Src, a new one is created. */ |