summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-03-08 10:25:46 +0100
committerHowaner <franzi.moos@googlemail.com>2014-03-08 10:25:46 +0100
commitf5e374be41ef3bde93e0faaa76208e3e0e15e9ea (patch)
tree9b97062eebbc063dca6953cc3057f7686f81c79c /src/WorldStorage/NBTChunkSerializer.cpp
parentLink cItem in the documentation (diff)
downloadcuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar.gz
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar.bz2
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar.lz
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar.xz
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.tar.zst
cuberite-f5e374be41ef3bde93e0faaa76208e3e0e15e9ea.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 6d0e29958..06b815333 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"
@@ -583,6 +584,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()) * 10);
+ m_Writer.EndCompound();
+}
+
+
+
+
+
void cNBTChunkSerializer::AddMinecartChestContents(cMinecartWithChest * a_Minecart)
{
m_Writer.BeginList("Items", TAG_Compound);
@@ -662,7 +675,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;