summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorarchshift <admin@archshft.com>2014-05-12 01:25:21 +0200
committerarchshift <admin@archshift.com>2014-05-12 01:28:48 +0200
commit3f9e00a3f3486c2845115e495d66f438f90825f3 (patch)
treef1ca0c7917206b47998ca6ee143fbbcbb3e50bf1 /src/WorldStorage
parentFixed a warning and a complaint about a never-read variable. (diff)
downloadcuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.gz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.bz2
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.lz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.xz
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.tar.zst
cuberite-3f9e00a3f3486c2845115e495d66f438f90825f3.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 2ac1d7962..ab80dd7c8 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();
}