Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundStopSoundPacket.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 342 /* > 1.12.2 */
2#pragma once
3
6
7namespace ProtocolCraft
8{
9 class ClientboundStopSoundPacket : public BaseMessage<ClientboundStopSoundPacket>
10 {
11 public:
12 static constexpr std::string_view packet_name = "Stop Sound";
13
14 DEFINE_CONDITION(Flags1, GetFlags() & 0x01);
15 DEFINE_CONDITION(Flags2, GetFlags() & 0x02);
16
17 SERIALIZED_FIELD(Flags, char);
20
22
23 GETTER(Source);
24 GETTER(Name_);
25
26 public:
27 auto& SetSource(const std::optional<int>& Source_)
28 {
29 SetFlags(Source.has_value() ? (GetFlags() | 0x01) : (GetFlags() & ~0x01));
30 Source = Source_;
31 return *this;
32 }
33
34 auto& SetName_(const std::optional<Identifier>& Name__)
35 {
36 SetFlags(Name_.has_value() ? (GetFlags() | 0x02) : (GetFlags() & ~0x02));
37 Name_ = Name__;
38 return *this;
39 }
40 };
41} //ProtocolCraft
42#endif
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Source, Internal::Conditioned< VarInt, &THIS::Flags1 >)
auto & SetSource(const std::optional< int > &Source_)
DEFINE_CONDITION(Flags2, GetFlags() &0x02)
auto & SetName_(const std::optional< Identifier > &Name__)
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Name_, Internal::Conditioned< Identifier, &THIS::Flags2 >)
DEFINE_CONDITION(Flags1, GetFlags() &0x01)
A type wrapper to conditionally serialize a type.
Definition Templates.hpp:83