Botcraft 1.21.4
Loading...
Searching...
No Matches
ClientboundMapItemDataPacket.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace ProtocolCraft
7{
8 class ClientboundMapItemDataPacket : public BaseMessage<ClientboundMapItemDataPacket>
9 {
10 public:
11 static constexpr std::string_view packet_name = "Map Item Data";
12
13 DEFINE_CONDITION(HasWidth, GetWidth() > 0);
15 SERIALIZED_FIELD(Scale, char);
16#if PROTOCOL_VERSION < 477 /* < 1.14 */
17 SERIALIZED_FIELD(TrackingPosition, bool);
18 SERIALIZED_FIELD(Decorations, std::vector<MapDecoration>);
19#elif PROTOCOL_VERSION < 755 /* < 1.17 */
20 SERIALIZED_FIELD(TrackingPosition, bool);
21 SERIALIZED_FIELD(Locked, bool);
22 SERIALIZED_FIELD(Decorations, std::vector<MapDecoration>);
23#else
24 SERIALIZED_FIELD(Locked, bool);
25 SERIALIZED_FIELD(Decorations, std::optional<std::vector<MapDecoration>>);
26#endif
27 SERIALIZED_FIELD(Width, unsigned char);
31 SERIALIZED_FIELD(MapColors, Internal::Conditioned<std::vector<unsigned char>, &THIS::HasWidth>);
32
34 };
35} //ProtocolCraft
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD(StartZ, Internal::Conditioned< unsigned char, &THIS::HasWidth >)
SERIALIZED_FIELD(StartX, Internal::Conditioned< unsigned char, &THIS::HasWidth >)
SERIALIZED_FIELD(MapColors, Internal::Conditioned< std::vector< unsigned char >, &THIS::HasWidth >)
SERIALIZED_FIELD(Decorations, std::optional< std::vector< MapDecoration > >)
SERIALIZED_FIELD(Height, Internal::Conditioned< unsigned char, &THIS::HasWidth >)
DEFINE_CONDITION(HasWidth, GetWidth() > 0)
A type wrapper to conditionally serialize a type.
Definition Templates.hpp:83