diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:50:34 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:50:34 +0200 |
commit | dcd226d9040409dec41c8f1f8909262946308ab0 (patch) | |
tree | 79479a67d634ae8a622f247acc283d2ea57888c6 /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | Added beacon documentation. (diff) | |
download | cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar.gz cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar.bz2 cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar.lz cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar.xz cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.tar.zst cuberite-dcd226d9040409dec41c8f1f8909262946308ab0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 4857da1b6..63387c33d 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -10,6 +10,7 @@ #include "../StringCompression.h" #include "FastNBT.h" +#include "../BlockEntities/BeaconEntity.h" #include "../BlockEntities/ChestEntity.h" #include "../BlockEntities/CommandBlockEntity.h" #include "../BlockEntities/DispenserEntity.h" @@ -176,6 +177,23 @@ void cNBTChunkSerializer::AddBasicTileEntity(cBlockEntity * a_Entity, const char +void cNBTChunkSerializer::AddBeaconEntity(cBeaconEntity * a_Entity) +{ + m_Writer.BeginCompound(""); + AddBasicTileEntity(a_Entity, "Beacon"); + m_Writer.AddInt("Levels", a_Entity->GetBeaconLevel()); + m_Writer.AddInt("Primary", (int)a_Entity->GetPrimaryPotion()); + m_Writer.AddInt("Secondary", (int)a_Entity->GetSecondaryPotion()); + m_Writer.BeginList("Items", TAG_Compound); + AddItemGrid(a_Entity->GetContents()); + m_Writer.EndList(); + m_Writer.EndCompound(); +} + + + + + void cNBTChunkSerializer::AddChestEntity(cChestEntity * a_Entity, BLOCKTYPE a_ChestType) { m_Writer.BeginCompound(""); @@ -825,6 +843,7 @@ void cNBTChunkSerializer::BlockEntity(cBlockEntity * a_Entity) // Add tile-entity into NBT: switch (a_Entity->GetBlockType()) { + case E_BLOCK_BEACON: AddBeaconEntity ((cBeaconEntity *) a_Entity); break; case E_BLOCK_CHEST: AddChestEntity ((cChestEntity *) a_Entity, a_Entity->GetBlockType()); break; case E_BLOCK_COMMAND_BLOCK: AddCommandBlockEntity((cCommandBlockEntity *)a_Entity); break; case E_BLOCK_DISPENSER: AddDispenserEntity ((cDispenserEntity *) a_Entity); break; |