diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-19 23:00:54 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-19 23:00:54 +0200 |
commit | 718eb227abe3b9a0e5277d663e32c6e10d51ab52 (patch) | |
tree | 5be83249ccd5b1ab4d2b87a4fa1597424d4e19b2 /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | Merge branch 'master' into MobSpawner (diff) | |
download | cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar.gz cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar.bz2 cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar.lz cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar.xz cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.tar.zst cuberite-718eb227abe3b9a0e5277d663e32c6e10d51ab52.zip |
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 68e541eba..a2bf3f8e1 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -18,6 +18,7 @@ #include "../BlockEntities/FurnaceEntity.h" #include "../BlockEntities/HopperEntity.h" #include "../BlockEntities/JukeboxEntity.h" +#include "../BlockEntities/MobSpawnerEntity.h" #include "../BlockEntities/NoteEntity.h" #include "../BlockEntities/SignEntity.h" #include "../BlockEntities/MobHeadEntity.h" @@ -278,6 +279,19 @@ void cNBTChunkSerializer::AddJukeboxEntity(cJukeboxEntity * a_Jukebox) +void cNBTChunkSerializer::AddMobSpawnerEntity(cMobSpawnerEntity * a_MobSpawner) +{ + m_Writer.BeginCompound(""); + AddBasicTileEntity(a_MobSpawner, "MobSpawner"); + m_Writer.AddString("EntityId", a_MobSpawner->GetEntityName()); + m_Writer.AddShort("Delay", (Int16)a_MobSpawner->GetSpawnDelay()); + m_Writer.EndCompound(); +} + + + + + void cNBTChunkSerializer::AddNoteEntity(cNoteEntity * a_Note) { m_Writer.BeginCompound(""); @@ -862,6 +876,7 @@ void cNBTChunkSerializer::BlockEntity(cBlockEntity * a_Entity) case E_BLOCK_HOPPER: AddHopperEntity ((cHopperEntity *) a_Entity); break; case E_BLOCK_JUKEBOX: AddJukeboxEntity ((cJukeboxEntity *) a_Entity); break; case E_BLOCK_LIT_FURNACE: AddFurnaceEntity ((cFurnaceEntity *) a_Entity); break; + case E_BLOCK_MOB_SPAWNER: AddMobSpawnerEntity ((cMobSpawnerEntity *) a_Entity); break; case E_BLOCK_NOTE_BLOCK: AddNoteEntity ((cNoteEntity *) a_Entity); break; case E_BLOCK_SIGN_POST: AddSignEntity ((cSignEntity *) a_Entity); break; case E_BLOCK_TRAPPED_CHEST: AddChestEntity ((cChestEntity *) a_Entity, a_Entity->GetBlockType()); break; |