summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-12-01 16:39:42 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-12-01 16:39:42 +0100
commitcd0081bb677c09b21fc5017dc1e01eaa18774698 (patch)
tree3a5ea294a105a298d91817a2599ae296b7c34d4b /src/WorldStorage/NBTChunkSerializer.cpp
parentAdded better soulsand rims (diff)
parentUpdated core (diff)
downloadcuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar.gz
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar.bz2
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar.lz
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar.xz
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.tar.zst
cuberite-cd0081bb677c09b21fc5017dc1e01eaa18774698.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 4daa8cc7b..432e122b5 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"
@@ -290,6 +291,20 @@ void cNBTChunkSerializer::AddJukeboxEntity(cJukeboxEntity * a_Jukebox)
+void cNBTChunkSerializer::AddMobSpawnerEntity(cMobSpawnerEntity * a_MobSpawner)
+{
+ m_Writer.BeginCompound("");
+ AddBasicTileEntity(a_MobSpawner, "MobSpawner");
+ m_Writer.AddShort("Entity", static_cast<short>(a_MobSpawner->GetEntity()));
+ m_Writer.AddString("EntityId", cMonster::MobTypeToVanillaName(a_MobSpawner->GetEntity()));
+ m_Writer.AddShort("Delay", a_MobSpawner->GetSpawnDelay());
+ m_Writer.EndCompound();
+}
+
+
+
+
+
void cNBTChunkSerializer::AddNoteEntity(cNoteEntity * a_Note)
{
m_Writer.BeginCompound("");
@@ -914,6 +929,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;