summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-16 14:04:06 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-16 14:04:06 +0200
commite64c40115ecb5ed843c7aa036f3b03e3c58ca033 (patch)
treecd9a532f3b34d7674291c23d12590214f0fc4c31 /source/WorldStorage/WSSAnvil.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadcuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar.gz
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar.bz2
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar.lz
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar.xz
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.tar.zst
cuberite-e64c40115ecb5ed843c7aa036f3b03e3c58ca033.zip
Diffstat (limited to 'source/WorldStorage/WSSAnvil.cpp')
-rw-r--r--source/WorldStorage/WSSAnvil.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/source/WorldStorage/WSSAnvil.cpp b/source/WorldStorage/WSSAnvil.cpp
index 3648d4462..efa0e9d3e 100644
--- a/source/WorldStorage/WSSAnvil.cpp
+++ b/source/WorldStorage/WSSAnvil.cpp
@@ -944,6 +944,14 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a
{
LoadMinecartFFromNBT(a_Entities, a_NBT, a_EntityTagIdx);
}
+ else if (strncmp(a_IDTag, "MinecartTNT", a_IDTagLength) == 0)
+ {
+ LoadMinecartTFromNBT(a_Entities, a_NBT, a_EntityTagIdx);
+ }
+ else if (strncmp(a_IDTag, "MinecartHopper", a_IDTagLength) == 0)
+ {
+ LoadMinecartHFromNBT(a_Entities, a_NBT, a_EntityTagIdx);
+ }
if (strncmp(a_IDTag, "Item", a_IDTagLength) == 0)
{
LoadPickupFromNBT(a_Entities, a_NBT, a_EntityTagIdx);
@@ -1027,6 +1035,40 @@ void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT
+void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
+{
+ std::auto_ptr<cMinecartWithTNT> Minecart(new cMinecartWithTNT(0, 0, 0));
+ if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
+ {
+ return;
+ }
+
+ //TODO: Everything to do with TNT carts
+
+ a_Entities.push_back(Minecart.release());
+}
+
+
+
+
+
+void cWSSAnvil::LoadMinecartHFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
+{
+ std::auto_ptr<cMinecartWithHopper> Minecart(new cMinecartWithHopper(0, 0, 0));
+ if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
+ {
+ return;
+ }
+
+ //TODO: Everything to do with hopper carts
+
+ a_Entities.push_back(Minecart.release());
+}
+
+
+
+
+
void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
int ItemTag = a_NBT.FindChildByName(a_TagIdx, "Item");