1
0

Added Rabbit Metadata values.

Added the Rabbit Types and the MoreCarrotTicks value. Types are selected randomly on creation.
Fixes #1867
This commit is contained in:
bibo38
2015-07-17 01:09:06 +02:00
parent c633dd8cec
commit 6a27ec2ea0
5 changed files with 109 additions and 54 deletions

View File

@@ -2396,7 +2396,18 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
std::unique_ptr<cRabbit> Monster = cpp14::make_unique<cRabbit>();
int TypeIdx = a_NBT.FindChildByName(a_TagIdx, "RabbitType");
int MoreCarrotTicksIdx = a_NBT.FindChildByName(a_TagIdx, "MoreCarrotTicks");
if ((TypeIdx < 0) || (MoreCarrotTicksIdx < 0))
{
return;
}
int Type = a_NBT.GetInt(TypeIdx);
int MoreCarrotTicks = a_NBT.GetInt(MoreCarrotTicksIdx);
std::unique_ptr<cRabbit> Monster = cpp14::make_unique<cRabbit>(static_cast<eRabbitType>(Type), MoreCarrotTicks);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;