summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-05-22 22:27:55 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-22 22:27:55 +0200
commit8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e (patch)
treed29525d02edb691c25e930b0d795d0dba160a34c /src/WorldStorage/WSSAnvil.cpp
parentSpawn eggs works again (diff)
downloadcuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar.gz
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar.bz2
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar.lz
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar.xz
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.tar.zst
cuberite-8a890cf945cfbd72f6e4b64f8c7b52d2c6ca099e.zip
Diffstat (limited to '')
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 971c6d88c..47f08e9cf 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -417,7 +417,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT
// Load the entities from NBT:
cEntityList Entities;
- cBlockEntityList BlockEntities;
+ cBlockEntities BlockEntities;
LoadEntitiesFromNBT (Entities, a_NBT, a_NBT.FindChildByName(Level, "Entities"));
LoadBlockEntitiesFromNBT(BlockEntities, a_NBT, a_NBT.FindChildByName(Level, "TileEntities"), BlockTypes, MetaData);
@@ -639,7 +639,7 @@ void cWSSAnvil::LoadEntitiesFromNBT(cEntityList & a_Entities, const cParsedNBT &
-void cWSSAnvil::LoadBlockEntitiesFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE * a_BlockTypes, NIBBLETYPE * a_BlockMetas)
+void cWSSAnvil::LoadBlockEntitiesFromNBT(cBlockEntities & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE * a_BlockTypes, NIBBLETYPE * a_BlockMetas)
{
if ((a_TagIdx < 0) || (a_NBT.GetType(a_TagIdx) != TAG_List))
{
@@ -673,7 +673,10 @@ void cWSSAnvil::LoadBlockEntitiesFromNBT(cBlockEntityList & a_BlockEntities, con
}
// Add the BlockEntity to the loaded data:
- a_BlockEntities.push_back(be.release());
+ auto Idx = cChunkDef::MakeIndex(be->GetRelX(), be->GetPosY(), be->GetRelZ());
+ a_BlockEntities.insert({ Idx, be.get() });
+ // Release after inserting in case it throws.
+ be.release();
} // for Child - tag children
}