Botcraft 26.2
Loading...
Searching...
No Matches
AdvancementDisplay.hpp
Go to the documentation of this file.
1#pragma once
2
5#if PROTOCOL_VERSION < 775 /* < 26.1 */
7#else
9#endif
11
12namespace ProtocolCraft
13{
15 {
16 DEFINE_CONDITION(HasBackgroundTexture, GetFlags() & 0x01);
17
19 SERIALIZED_FIELD(Description, Chat);
20#if PROTOCOL_VERSION < 775 /* < 26.1 */
22#else
24#endif
26 SERIALIZED_FIELD(Flags, int);
28 SERIALIZED_FIELD(XCoord, float);
29 SERIALIZED_FIELD(YCoord, float);
30
32
33 GETTER(BackgroundTexture);
34 public:
35 auto& SetBackgroundTexture(const std::optional<Identifier>& BackgroundTexture_)
36 {
37 SetFlags(BackgroundTexture_.has_value() ? (GetFlags() | 0x01) : (GetFlags() & ~0x01));
38 BackgroundTexture = BackgroundTexture_;
39 return *this;
40 }
41 };
42}
#define SERIALIZED_FIELD(Name,...)
auto & SetBackgroundTexture(const std::optional< Identifier > &BackgroundTexture_)
SERIALIZED_FIELD(FrameType, VarInt)
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(BackgroundTexture, Internal::Conditioned< Identifier, &AdvancementDisplay::HasBackgroundTexture >)
SERIALIZED_FIELD(Icon, ItemStackTemplate)
DEFINE_CONDITION(HasBackgroundTexture, GetFlags() &0x01)
SERIALIZED_FIELD(Description, Chat)
A type wrapper to conditionally serialize a type.
Definition Templates.hpp:83