summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-02 22:07:34 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-02 22:07:34 +0200
commit89a26cc786f3673cf7b5a100300d8aa595735cc3 (patch)
treebb730e4d205d596232ad1941d92c7a2c5a5a0e72 /src/WorldStorage/NBTChunkSerializer.cpp
parentVector clamping fixes (diff)
downloadcuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar.gz
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar.bz2
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar.lz
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar.xz
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.tar.zst
cuberite-89a26cc786f3673cf7b5a100300d8aa595735cc3.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 8294d4a00..e49042ff7 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -589,20 +589,19 @@ void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
m_Writer.BeginCompound("");
AddBasicEntity(a_Projectile, a_Projectile->GetMCAClassName());
Vector3d Pos = a_Projectile->GetPosition();
- m_Writer.AddShort("xTile", (Int16)floor(Pos.x));
- m_Writer.AddShort("yTile", (Int16)floor(Pos.y));
- m_Writer.AddShort("zTile", (Int16)floor(Pos.z));
- m_Writer.AddShort("inTile", 0); // TODO: Query the block type
- m_Writer.AddShort("shake", 0); // TODO: Any shake?
- m_Writer.AddByte ("inGround", a_Projectile->IsInGround() ? 1 : 0);
+ m_Writer.AddByte("inGround", a_Projectile->IsInGround() ? 1 : 0);
switch (a_Projectile->GetProjectileKind())
{
case cProjectileEntity::pkArrow:
{
- m_Writer.AddByte("inData", 0); // TODO: Query the block meta (is it needed?)
- m_Writer.AddByte("pickup", ((cArrowEntity *)a_Projectile)->GetPickupState());
- m_Writer.AddDouble("damage", ((cArrowEntity *)a_Projectile)->GetDamageCoeff());
+ cArrowEntity * Arrow = (cArrowEntity *)a_Projectile;
+
+ m_Writer.AddInt("xTile", (Int16)Arrow->GetBlockHit().x);
+ m_Writer.AddInt("yTile", (Int16)Arrow->GetBlockHit().y);
+ m_Writer.AddInt("zTile", (Int16)Arrow->GetBlockHit().z);
+ m_Writer.AddByte("pickup", Arrow->GetPickupState());
+ m_Writer.AddDouble("damage", Arrow->GetDamageCoeff());
break;
}
case cProjectileEntity::pkGhastFireball: