diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-26 19:50:42 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-26 19:50:42 +0200 |
commit | 6ad8553a3a9095bd5a8c25085fa0bb209d411048 (patch) | |
tree | c6ba74fd34eb0f599e2037ac120bfae30314f0dd /source/WSSCompact.cpp | |
parent | Removed old makefile; use GNUmakefile instead (diff) | |
download | cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar.gz cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar.bz2 cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar.lz cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar.xz cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.tar.zst cuberite-6ad8553a3a9095bd5a8c25085fa0bb209d411048.zip |
Diffstat (limited to 'source/WSSCompact.cpp')
-rw-r--r-- | source/WSSCompact.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/source/WSSCompact.cpp b/source/WSSCompact.cpp index 406b55d38..a47c62dcb 100644 --- a/source/WSSCompact.cpp +++ b/source/WSSCompact.cpp @@ -12,6 +12,7 @@ #include "cChestEntity.h" #include "cSignEntity.h" #include "cFurnaceEntity.h" +#include "cNoteEntity.h" #include "BlockID.h" @@ -73,7 +74,8 @@ void cJsonChunkSerializer::BlockEntity(cBlockEntity * a_BlockEntity) case E_BLOCK_FURNACE: SaveInto = "Furnaces"; break; case E_BLOCK_SIGN_POST: SaveInto = "Signs"; break; case E_BLOCK_WALLSIGN: SaveInto = "Signs"; break; - + case E_BLOCK_NOTE_BLOCK: SaveInto = "Notes"; break; + default: { ASSERT(!"Unhandled blocktype in BlockEntities list while saving to JSON"); @@ -316,6 +318,26 @@ void cWSSCompact::LoadEntitiesFromJson(Json::Value & a_Value, cEntityList & a_En } } // for itr - AllSigns[] } + + // Load note blocks + Json::Value AllNotes = a_Value.get("Notes", Json::nullValue); + if( !AllNotes.empty() ) + { + for( Json::Value::iterator itr = AllNotes.begin(); itr != AllNotes.end(); ++itr ) + { + Json::Value & Note = *itr; + cNoteEntity * NoteEntity = new cNoteEntity(0, 0, 0, a_World); + if ( !NoteEntity->LoadFromJson( Note ) ) + { + LOGERROR("ERROR READING NOTE BLOCK FROM JSON!" ); + delete NoteEntity; + } + else + { + a_BlockEntities.push_back( NoteEntity ); + } + } // for itr - AllNotes[] + } } |