summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol125.cpp9
-rw-r--r--src/Protocol/Protocol17x.cpp9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index a23afb29a..3951eb3e4 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -2013,7 +2013,14 @@ void cProtocol125::WriteMobMetadata(const cMonster & a_Mob)
case cMonster::mtWither:
{
WriteByte(0x54); // Int at index 20
- WriteInt((Int32)((const cWither &)a_Mob).GetWitherInvulnerableTicks());
+ if (((const cWither &)a_Mob).IsSpawnInvulnerable())
+ {
+ WriteInt((Int32)((const cWither &)a_Mob).GetInvulnerableTicks());
+ }
+ else
+ {
+ WriteInt((Int32)0);
+ }
WriteByte(0x66); // Float at index 6
WriteFloat((float)(a_Mob.GetHealth()));
break;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 80b161e3e..311e770f9 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -2820,7 +2820,14 @@ void cProtocol172::cPacketizer::WriteMobMetadata(const cMonster & a_Mob)
case cMonster::mtWither:
{
WriteByte(0x54); // Int at index 20
- WriteInt(((const cWither &)a_Mob).GetWitherInvulnerableTicks());
+ if (((const cWither &)a_Mob).IsSpawnInvulnerable())
+ {
+ WriteInt(((const cWither &)a_Mob).GetInvulnerableTicks());
+ }
+ else
+ {
+ WriteInt(0);
+ }
WriteByte(0x66); // Float at index 6
WriteFloat((float)(a_Mob.GetHealth()));
break;