Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundSetScorePacket.hpp
Go to the documentation of this file.
1#pragma once
2
4#if PROTOCOL_VERSION > 764 /* > 1.20.2 */
6#endif
7
8namespace ProtocolCraft
9{
10#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
11 enum class SetScoreMethod
12 {
13 Change = 0,
14 Remove = 1
15 };
16#endif
17
18 class ClientboundSetScorePacket : public BaseMessage<ClientboundSetScorePacket>
19 {
20 public:
21 static constexpr std::string_view packet_name = "Set Score";
22
23#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
24 DEFINE_CONDITION(NotRemove, GetMethod() != SetScoreMethod::Remove);
25 SERIALIZED_FIELD(Owner, std::string);
27 SERIALIZED_FIELD(ObjectiveName, std::string);
29#else
30 SERIALIZED_FIELD(Owner, std::string);
31 SERIALIZED_FIELD(ObjectiveName, std::string);
33 SERIALIZED_FIELD(Display, std::optional<Chat>);
34 SERIALIZED_FIELD(NumberFormat, std::optional<ProtocolCraft::NumberFormat>);
35#endif
36
38 };
39} //ProtocolCraft
#define DEFINE_CONDITION(Name,...)
Define a condition that can be used later inside an Internal::Conditioned type.
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD(NumberFormat, std::optional< ProtocolCraft::NumberFormat >)
SERIALIZED_FIELD(Display, std::optional< Chat >)
SERIALIZED_FIELD(ObjectiveName, std::string)
A type wrapper to conditionally serialize a type.
Definition Templates.hpp:83
Just a simple type wrapper that will store with T1 and serialize as T2 (can be used for Enum/VarInt f...
Definition Templates.hpp:72