Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundPlayerCombatPacket.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION < 755 /* < 1.17 */
2#pragma once
3
6
7namespace ProtocolCraft
8{
9 class ClientboundPlayerCombatPacket : public BaseMessage<ClientboundPlayerCombatPacket>
10 {
11 public:
12 static constexpr std::string_view packet_name = "Player Combat";
13
14 DEFINE_CONDITION(Event1, GetEvent() == 1);
15 DEFINE_CONDITION(Event12, GetEvent() == 1 || GetEvent() == 2);
16 DEFINE_CONDITION(Event2, GetEvent() == 2);
17
18 SERIALIZED_FIELD(Event, VarInt);
19 SERIALIZED_FIELD(Duration, Internal::Conditioned<VarInt, &THIS::Event1>);
20 SERIALIZED_FIELD(PlayerId, Internal::Conditioned<VarInt, &THIS::Event2>);
21 SERIALIZED_FIELD(KillerId, Internal::Conditioned<int, &THIS::Event12>);
22 SERIALIZED_FIELD(Message, Internal::Conditioned<Chat, &THIS::Event2>);
23
25 };
26} //ProtocolCraft
27#endif
#define DEFINE_CONDITION(Name,...)
Define a condition that can be used later inside an Internal::Conditioned type.
#define DECLARE_READ_WRITE_SERIALIZE
Define auto serializable utilities and declare ReadImpl, WriteImpl and SerializeImpl virtual function...
#define SERIALIZED_FIELD(Name,...)