1
0

Exported boat

- NBT: Added saving / loading of material
- Added the material in the item handler of the boat
- Drop the correct boat if destroyed
- APIDoc: Added desc and functions
This commit is contained in:
Lukas Pioch
2017-05-09 14:21:25 +02:00
parent 84bdba345d
commit 73a3c4e3be
15 changed files with 315 additions and 19 deletions

View File

@@ -1659,11 +1659,17 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
std::unique_ptr<cBoat> Boat = cpp14::make_unique<cBoat>(0, 0, 0);
std::unique_ptr<cBoat> Boat = cpp14::make_unique<cBoat>(0, 0, 0, cBoat::bmOak);
if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx))
{
return;
}
int TypeIdx = a_NBT.FindChildByName(a_TagIdx, "Type");
if (TypeIdx > 0)
{
Boat->SetMaterial(cBoat::StringToMaterial(a_NBT.GetString(TypeIdx)));
}
a_Entities.push_back(Boat.release());
}