diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-16 21:19:46 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-16 21:19:46 +0200 |
commit | 4face38fdc6872f7e1ad26c28baa52836a2e709f (patch) | |
tree | 9ee407dd1d3ab05c100888d91318950e8c5e968b /source/WorldStorage/WSSAnvil.cpp | |
parent | Replaced E_ENTITY_TYPE_XXX with cMonster::mtXXX. (diff) | |
parent | Another compile fix (diff) | |
download | cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar.gz cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar.bz2 cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar.lz cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar.xz cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.tar.zst cuberite-4face38fdc6872f7e1ad26c28baa52836a2e709f.zip |
Diffstat (limited to '')
-rw-r--r-- | source/WorldStorage/WSSAnvil.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source/WorldStorage/WSSAnvil.cpp b/source/WorldStorage/WSSAnvil.cpp index 8f23cc773..efa0e9d3e 100644 --- a/source/WorldStorage/WSSAnvil.cpp +++ b/source/WorldStorage/WSSAnvil.cpp @@ -928,6 +928,8 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a case 0: LoadMinecartRFromNBT(a_Entities, a_NBT, a_EntityTagIdx); break; // Rideable minecart case 1: LoadMinecartCFromNBT(a_Entities, a_NBT, a_EntityTagIdx); break; // Minecart with chest case 2: LoadMinecartFFromNBT(a_Entities, a_NBT, a_EntityTagIdx); break; // Minecart with furnace + case 3: LoadMinecartTFromNBT(a_Entities, a_NBT, a_EntityTagIdx); break; // Minecart with TNT + case 4: LoadMinecartHFromNBT(a_Entities, a_NBT, a_EntityTagIdx); break; // Minecart with Hopper } } else if (strncmp(a_IDTag, "MinecartRideable", a_IDTagLength) == 0) @@ -942,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); @@ -1025,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"); |