Botcraft 1.21.5
Loading...
Searching...
No Matches
ServerboundContainerClickPacket.hpp
Go to the documentation of this file.
1#pragma once
2
4#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
6#else
8#endif
9#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
10#include <map>
11#endif
12
13namespace ProtocolCraft
14{
15 class ServerboundContainerClickPacket : public BasePacket<ServerboundContainerClickPacket>
16 {
17 public:
18 static constexpr std::string_view packet_name = "Container Click";
19
20#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
21 SERIALIZED_FIELD(ContainerId, unsigned char);
22#else
23 SERIALIZED_FIELD(ContainerId, VarInt);
24#endif
25#if PROTOCOL_VERSION > 755 /* > 1.17 */
27#endif
28 SERIALIZED_FIELD(SlotNum, short);
29 SERIALIZED_FIELD(ButtonNum, char);
30#if PROTOCOL_VERSION < 755 /* < 1.17 */
31 SERIALIZED_FIELD(Uid, short);
32#endif
34#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
35#if PROTOCOL_VERSION > 754 /* > 1.16.5 */
36 SERIALIZED_FIELD(ChangedSlots, std::map<short, Slot>);
37#endif
38 SERIALIZED_FIELD(CarriedItem, Slot);
39#else
40 SERIALIZED_FIELD(ChangedSlots, std::map<short, HashedSlot>);
42#endif
43
45 };
46} //ProtocolCraft
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD(ChangedSlots, std::map< short, HashedSlot >)