summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 22:44:32 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 22:44:32 +0100
commit09c5542123bcde7d9c40c35679f3ff499eb50125 (patch)
treef357cf6e6a6cb8ce10ab26f7379d07683a84ac54 /src/WorldStorage/NBTChunkSerializer.cpp
parentMerge pull request #731 from mc-server/ballisticmissiles (diff)
parentChange tnt documentation to ticks (diff)
downloadcuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar.gz
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar.bz2
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar.lz
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar.xz
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.tar.zst
cuberite-09c5542123bcde7d9c40c35679f3ff499eb50125.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index e9fa11fe6..4cf3c62d7 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -28,6 +28,7 @@
#include "../Entities/Minecart.h"
#include "../Entities/Pickup.h"
#include "../Entities/ProjectileEntity.h"
+#include "../Entities/TNTEntity.h"
#include "../Mobs/Monster.h"
#include "../Mobs/Bat.h"
@@ -591,6 +592,18 @@ void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
+void cNBTChunkSerializer::AddTNTEntity(cTNTEntity * a_TNT)
+{
+ m_Writer.BeginCompound("");
+ AddBasicEntity(a_TNT, "PrimedTnt");
+ m_Writer.AddByte("Fuse", (unsigned char)a_TNT->GetFuseTicks());
+ m_Writer.EndCompound();
+}
+
+
+
+
+
void cNBTChunkSerializer::AddMinecartChestContents(cMinecartWithChest * a_Minecart)
{
m_Writer.BeginList("Items", TAG_Compound);
@@ -670,7 +683,7 @@ void cNBTChunkSerializer::Entity(cEntity * a_Entity)
case cEntity::etMonster: AddMonsterEntity ((cMonster *) a_Entity); break;
case cEntity::etPickup: AddPickupEntity ((cPickup *) a_Entity); break;
case cEntity::etProjectile: AddProjectileEntity ((cProjectileEntity *)a_Entity); break;
- case cEntity::etTNT: /* TODO */ break;
+ case cEntity::etTNT: AddTNTEntity ((cTNTEntity *) a_Entity); break;
case cEntity::etExpOrb: /* TODO */ break;
case cEntity::etItemFrame: /* TODO */ break;
case cEntity::etPainting: /* TODO */ break;