summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-03-15 00:32:49 +0100
committerHowaner <franzi.moos@googlemail.com>2014-03-15 00:32:49 +0100
commit28898f710b191abb610f31085d6ae076511cc89c (patch)
treee824b9cd817f86bcfe8b1d95eab9f227af1945a9 /src/WorldStorage/NBTChunkSerializer.cpp
parentAdd fireball interact (diff)
downloadcuberite-28898f710b191abb610f31085d6ae076511cc89c.tar
cuberite-28898f710b191abb610f31085d6ae076511cc89c.tar.gz
cuberite-28898f710b191abb610f31085d6ae076511cc89c.tar.bz2
cuberite-28898f710b191abb610f31085d6ae076511cc89c.tar.lz
cuberite-28898f710b191abb610f31085d6ae076511cc89c.tar.xz
cuberite-28898f710b191abb610f31085d6ae076511cc89c.tar.zst
cuberite-28898f710b191abb610f31085d6ae076511cc89c.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 17cf838c3..fa5547f46 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -29,6 +29,7 @@
#include "../Entities/Pickup.h"
#include "../Entities/ProjectileEntity.h"
#include "../Entities/TNTEntity.h"
+#include "../Entities/ExpOrb.h"
#include "../Mobs/Monster.h"
#include "../Mobs/Bat.h"
@@ -596,6 +597,20 @@ void cNBTChunkSerializer::AddTNTEntity(cTNTEntity * a_TNT)
+void cNBTChunkSerializer::AddExpOrbEntity(cExpOrb* a_ExpOrb)
+{
+ m_Writer.BeginCompound("");
+ AddBasicEntity(a_ExpOrb, "XPOrb");
+ m_Writer.AddShort("Health", (short)(unsigned char)a_ExpOrb->GetHealth());
+ m_Writer.AddShort("Age", (short)a_ExpOrb->GetAge());
+ m_Writer.AddShort("Value", (short)a_ExpOrb->GetReward());
+ m_Writer.EndCompound();
+}
+
+
+
+
+
void cNBTChunkSerializer::AddMinecartChestContents(cMinecartWithChest * a_Minecart)
{
m_Writer.BeginList("Items", TAG_Compound);
@@ -676,7 +691,7 @@ void cNBTChunkSerializer::Entity(cEntity * a_Entity)
case cEntity::etPickup: AddPickupEntity ((cPickup *) a_Entity); break;
case cEntity::etProjectile: AddProjectileEntity ((cProjectileEntity *)a_Entity); break;
case cEntity::etTNT: AddTNTEntity ((cTNTEntity *) a_Entity); break;
- case cEntity::etExpOrb: /* TODO */ break;
+ case cEntity::etExpOrb: AddExpOrbEntity ((cExpOrb *) a_Entity); break;
case cEntity::etItemFrame: /* TODO */ break;
case cEntity::etPainting: /* TODO */ break;
case cEntity::etPlayer: return; // Players aren't saved into the world