Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundSetTitlesPacket.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION < 755 /* < 1.17 */
2#pragma once
3
6
7namespace ProtocolCraft
8{
9 enum class SetTitlesType
10 {
11 Title = 0,
12 Subtitle = 1,
13 ActionBar = 2,
14 Times = 3,
15 Clear = 4,
16 Reset = 5
17 };
18
19 class ClientboundSetTitlesPacket : public BaseMessage<ClientboundSetTitlesPacket>
20 {
21 public:
22 static constexpr std::string_view packet_name = "Set Titles";
23
24 DEFINE_CONDITION(HasText, GetType() == SetTitlesType::Title || GetType() == SetTitlesType::Subtitle || GetType() == SetTitlesType::ActionBar);
25 DEFINE_CONDITION(HasTimes, GetType() == SetTitlesType::Times);
26
27 SERIALIZED_FIELD(Type, Internal::DiffType<SetTitlesType, VarInt>);
28 SERIALIZED_FIELD(Text, Internal::Conditioned<Chat, &THIS::HasText>);
29 SERIALIZED_FIELD(FadeInTime, Internal::Conditioned<int, &THIS::HasTimes>);
30 SERIALIZED_FIELD(StayTime, Internal::Conditioned<int, &THIS::HasTimes>);
31 SERIALIZED_FIELD(FadeOutTime, Internal::Conditioned<int, &THIS::HasTimes>);
32
34 };
35} //ProtocolCraft
36#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,...)