summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;