diff options
author | Mattes D <github@xoft.cz> | 2014-08-01 17:43:02 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-08-01 17:43:02 +0200 |
commit | 35cfbfd51a15233bb0860804c525597d95260300 (patch) | |
tree | b11052934d85badc24e2d17ef1e51b5ea64040ec /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | Merge pull request #1270 from Howaner/Options (diff) | |
parent | Use "default:" in switch. (diff) | |
download | cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar.gz cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar.bz2 cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar.lz cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar.xz cuberite-35cfbfd51a15233bb0860804c525597d95260300.tar.zst cuberite-35cfbfd51a15233bb0860804c525597d95260300.zip |
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-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..601cd8833 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->GetPrimaryEffect()); + m_Writer.AddInt("Secondary", (int)a_Entity->GetSecondaryEffect()); + 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; |