1
0

Protocol: Wither metadata

This commit is contained in:
andrew
2014-03-25 10:32:58 +02:00
parent 4f3377bbbf
commit 0fe1e50ffc
5 changed files with 116 additions and 3 deletions

View File

@@ -21,6 +21,15 @@ cWither::cWither(void) :
bool cWither::IsArmored(void) const
{
return GetHealth() <= (GetMaxHealth() / 2);
}
void cWither::DoTakeDamage(TakeDamageInfo & a_TDI)
{
if (a_TDI.DamageType == dtDrowning)
@@ -33,6 +42,11 @@ void cWither::DoTakeDamage(TakeDamageInfo & a_TDI)
return;
}
if (IsArmored() && (a_TDI.DamageType == dtRangedAttack))
{
return;
}
super::DoTakeDamage(a_TDI);
}
@@ -60,6 +74,8 @@ void cWither::Tick(float a_Dt, cChunk & a_Chunk)
Heal(10);
}
}
m_World->BroadcastEntityMetadata(*this);
}