diff options
author | Mattes D <github@xoft.cz> | 2014-05-12 08:51:07 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-12 08:51:07 +0200 |
commit | 702643d7e65d73a94b1ccfcdd21271f320a7e0a0 (patch) | |
tree | 0f1f08f4c0c0be97f42d793af85daec1bedf89a1 /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | Merge pull request #972 from mc-server/SslWebAdmin (diff) | |
parent | More switch warnings. (diff) | |
download | cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.gz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.bz2 cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.lz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.xz cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.tar.zst cuberite-702643d7e65d73a94b1ccfcdd21271f320a7e0a0.zip |
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 2ac1d7962..7b7cd3c7e 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -391,38 +391,41 @@ void cNBTChunkSerializer::AddFallingBlockEntity(cFallingBlock * a_FallingBlock) void cNBTChunkSerializer::AddMinecartEntity(cMinecart * a_Minecart) { - const char * EntityClass = NULL; - switch (a_Minecart->GetPayload()) - { - case cMinecart::mpNone: EntityClass = "MinecartRideable"; break; - case cMinecart::mpChest: EntityClass = "MinecartChest"; break; - case cMinecart::mpFurnace: EntityClass = "MinecartFurnace"; break; - case cMinecart::mpTNT: EntityClass = "MinecartTNT"; break; - case cMinecart::mpHopper: EntityClass = "MinecartHopper"; break; - default: - { - ASSERT(!"Unhandled minecart payload type"); - return; - } - } // switch (payload) - m_Writer.BeginCompound(""); - AddBasicEntity(a_Minecart, EntityClass); + switch (a_Minecart->GetPayload()) { case cMinecart::mpChest: { + AddBasicEntity(a_Minecart, "MinecartChest"); // Add chest contents into the Items tag: AddMinecartChestContents((cMinecartWithChest *)a_Minecart); break; } - case cMinecart::mpFurnace: { + AddBasicEntity(a_Minecart, "MinecartFurnace"); // TODO: Add "Push" and "Fuel" tags break; } + case cMinecart::mpHopper: + { + AddBasicEntity(a_Minecart, "MinecartHopper"); + // TODO: Add hopper contents? + break; + } + case cMinecart::mpTNT: + { + AddBasicEntity(a_Minecart, "MinecartTNT"); + break; + } + case cMinecart::mpNone: + { + AddBasicEntity(a_Minecart, "MinecartRideable"); + break; + } } // switch (Payload) + m_Writer.EndCompound(); } @@ -650,6 +653,13 @@ void cNBTChunkSerializer::AddHangingEntity(cHangingEntity * a_Hanging) case BLOCK_FACE_YP: m_Writer.AddByte("Dir", (unsigned char)1); break; case BLOCK_FACE_ZM: m_Writer.AddByte("Dir", (unsigned char)0); break; case BLOCK_FACE_ZP: m_Writer.AddByte("Dir", (unsigned char)3); break; + + case BLOCK_FACE_XM: + case BLOCK_FACE_XP: + case BLOCK_FACE_NONE: + { + break; + } } } |