summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2018-02-03 12:24:19 +0100
committerAlexander Harkness <me@bearbin.net>2020-04-10 01:50:45 +0200
commit8438def87e40e43fd66d38dbf8cc287cea7de29b (patch)
tree647b7674cca3df58507e5311e5578d14084bc691 /src/Protocol
parentRe-enable darwin download from easyinstall.sh script (diff)
downloadcuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.gz
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.bz2
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.lz
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.xz
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.zst
cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol_1_10.cpp21
-rw-r--r--src/Protocol/Protocol_1_11.cpp26
-rw-r--r--src/Protocol/Protocol_1_12.cpp20
-rw-r--r--src/Protocol/Protocol_1_8.cpp16
-rw-r--r--src/Protocol/Protocol_1_9.cpp21
5 files changed, 86 insertions, 18 deletions
diff --git a/src/Protocol/Protocol_1_10.cpp b/src/Protocol/Protocol_1_10.cpp
index 8a23ec09d..83df39a6c 100644
--- a/src/Protocol/Protocol_1_10.cpp
+++ b/src/Protocol/Protocol_1_10.cpp
@@ -1008,11 +1008,11 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_
a_Pkt.WriteBEUInt8(ZOMBIE_TYPE);
a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
- a_Pkt.WriteVarInt32(Zombie.IsVillagerZombie() ? 1 : 0); // TODO: This actually encodes the zombie villager profession, but that isn't implemented yet.
+ a_Pkt.WriteVarInt32(0);
a_Pkt.WriteBEUInt8(ZOMBIE_CONVERTING);
a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
- a_Pkt.WriteBool(Zombie.IsConverting());
+ a_Pkt.WriteBool(false);
break;
} // case mtZombie
@@ -1025,6 +1025,23 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_
break;
} // case mtZombiePigman
+ case mtZombieVillager:
+ {
+ auto & ZombieVillager = reinterpret_cast<const cZombieVillager &>(a_Mob);
+ a_Pkt.WriteBEUInt8(ZOMBIE_IS_BABY);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.IsBaby());
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_TYPE);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(ZombieVillager.GetProfession());
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_CONVERTING);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.ConversionTime() != -1);
+ break;
+ } // case mtZombieVillager
+
default: break;
} // switch (a_Mob.GetType())
}
diff --git a/src/Protocol/Protocol_1_11.cpp b/src/Protocol/Protocol_1_11.cpp
index 8a846b540..7e46fa332 100644
--- a/src/Protocol/Protocol_1_11.cpp
+++ b/src/Protocol/Protocol_1_11.cpp
@@ -1182,15 +1182,6 @@ void cProtocol_1_11_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_
a_Pkt.WriteBEUInt8(ZOMBIE_IS_BABY);
a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
a_Pkt.WriteBool(Zombie.IsBaby());
-
- // These don't exist
- // a_Pkt.WriteBEUInt8(ZOMBIE_TYPE);
- // a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
- // a_Pkt.WriteVarInt32(Zombie.IsVillagerZombie() ? 1 : 0);
-
- // a_Pkt.WriteBEUInt8(ZOMBIE_CONVERTING);
- // a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
- // a_Pkt.WriteBool(Zombie.IsConverting());
break;
} // case mtZombie
@@ -1203,6 +1194,23 @@ void cProtocol_1_11_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_
break;
} // case mtZombiePigman
+ case mtZombieVillager:
+ {
+ auto & ZombieVillager = reinterpret_cast<const cZombieVillager &>(a_Mob);
+ a_Pkt.WriteBEUInt8(ZOMBIE_IS_BABY);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.IsBaby());
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_VILLAGER_CONVERTING);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(static_cast<UInt32>(ZombieVillager.ConversionTime()));
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_VILLAGER_PROFESSION);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(static_cast<UInt32>(ZombieVillager.GetProfession()));
+ break;
+ } // case mtZombieVillager
+
default: break;
} // switch (a_Mob.GetType())
}
diff --git a/src/Protocol/Protocol_1_12.cpp b/src/Protocol/Protocol_1_12.cpp
index 01bbf8104..8cf8df6ca 100644
--- a/src/Protocol/Protocol_1_12.cpp
+++ b/src/Protocol/Protocol_1_12.cpp
@@ -908,9 +908,6 @@ void cProtocol_1_12::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mo
// a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
// a_Pkt.WriteVarInt32(Zombie.IsVillagerZombie() ? 1 : 0);
- // a_Pkt.WriteBEUInt8(ZOMBIE_CONVERTING);
- // a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
- // a_Pkt.WriteBool(Zombie.IsConverting());
break;
} // case mtZombie
@@ -923,6 +920,23 @@ void cProtocol_1_12::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mo
break;
} // case mtZombiePigman
+ case mtZombieVillager:
+ {
+ auto & ZombieVillager = reinterpret_cast<const cZombieVillager &>(a_Mob);
+ a_Pkt.WriteBEUInt8(ZOMBIE_IS_BABY);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.IsBaby());
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_VILLAGER_CONVERTING);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(static_cast<UInt32>(ZombieVillager.ConversionTime()));
+
+ a_Pkt.WriteBEUInt8(ZOMBIE_VILLAGER_PROFESSION);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(static_cast<UInt32>(ZombieVillager.GetProfession()));
+ break;
+ } // case mtZombieVillager
+
case mtBlaze:
case mtEnderDragon:
case mtGuardian:
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 1b3c261f5..a516ec891 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -3825,9 +3825,9 @@ void cProtocol_1_8_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_M
a_Pkt.WriteBEUInt8(0x0c);
a_Pkt.WriteBEInt8(Zombie.IsBaby() ? 1 : -1);
a_Pkt.WriteBEUInt8(0x0d);
- a_Pkt.WriteBEUInt8(Zombie.IsVillagerZombie() ? 1 : 0);
+ a_Pkt.WriteBEUInt8(0);
a_Pkt.WriteBEUInt8(0x0e);
- a_Pkt.WriteBEUInt8(Zombie.IsConverting() ? 1 : 0);
+ a_Pkt.WriteBEUInt8(0);
break;
} // case mtZombie
@@ -3839,6 +3839,18 @@ void cProtocol_1_8_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_M
break;
} // case mtZombiePigman
+ case mtZombieVillager:
+ {
+ auto & ZombieVillager = reinterpret_cast<const cZombieVillager &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(ZombieVillager.IsBaby() ? 1 : -1);
+ a_Pkt.WriteBEUInt8(0x0d);
+ a_Pkt.WriteBEUInt8(1);
+ a_Pkt.WriteBEUInt8(0x0e);
+ a_Pkt.WriteBEUInt8((ZombieVillager.ConversionTime() == -1) ? 0 : 1);
+ break;
+ } // case mtZombieVillager
+
default: break;
} // switch (a_Mob.GetType())
}
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index 9f786b02d..e33b65b69 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -4329,11 +4329,11 @@ void cProtocol_1_9_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_M
a_Pkt.WriteBEUInt8(12); // Index 12: Is a villager
a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
- a_Pkt.WriteVarInt32(Zombie.IsVillagerZombie() ? 1 : 0); // TODO: This actually encodes the zombie villager profession, but that isn't implemented yet.
+ a_Pkt.WriteVarInt32(0);
a_Pkt.WriteBEUInt8(13); // Index 13: Is converting
a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
- a_Pkt.WriteBool(Zombie.IsConverting());
+ a_Pkt.WriteBool(false);
break;
} // case mtZombie
@@ -4346,6 +4346,23 @@ void cProtocol_1_9_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_M
break;
} // case mtZombiePigman
+ case mtZombieVillager:
+ {
+ auto & ZombieVillager = reinterpret_cast<const cZombieVillager &>(a_Mob);
+ a_Pkt.WriteBEUInt8(11); // Index 11: Is baby
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.IsBaby());
+
+ a_Pkt.WriteBEUInt8(12); // Index 12: Is a villager
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT);
+ a_Pkt.WriteVarInt32(ZombieVillager.GetProfession());
+
+ a_Pkt.WriteBEUInt8(13); // Index 13: Is converting
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL);
+ a_Pkt.WriteBool(ZombieVillager.ConversionTime() != -1);
+ break;
+ } // case mtZombieVillager
+
default: break;
} // switch (a_Mob.GetType())
}