Botcraft
1.21.4
Loading...
Searching...
No Matches
ClientboundOpenScreenPacket.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
protocolCraft/BaseMessage.hpp
"
4
#include "
protocolCraft/Types/Chat/Chat.hpp
"
5
6
namespace
ProtocolCraft
7
{
8
class
ClientboundOpenScreenPacket
:
public
BaseMessage
<ClientboundOpenScreenPacket>
9
{
10
public
:
11
static
constexpr
std::string_view
packet_name
=
"Open Screen"
;
12
13
#if PROTOCOL_VERSION < 477
/* < 1.14 */
14
DEFINE_CONDITION
(IsHorse, GetType() ==
"EntityHorse"
);
15
SERIALIZED_FIELD
(ContainerId,
unsigned
char
);
16
SERIALIZED_FIELD
(Type, std::string);
17
SERIALIZED_FIELD
(Title,
Chat
);
18
SERIALIZED_FIELD
(NumberOfSlots,
unsigned
char
);
19
SERIALIZED_FIELD
(Id_,
Internal::Conditioned<int, &THIS::IsHorse>
);
20
#else
21
SERIALIZED_FIELD
(ContainerId,
VarInt
);
22
SERIALIZED_FIELD
(Type,
VarInt
);
23
SERIALIZED_FIELD
(Title,
Chat
);
24
#endif
25
26
DECLARE_READ_WRITE_SERIALIZE
;
27
};
28
}
//ProtocolCraft
DEFINE_CONDITION
#define DEFINE_CONDITION(Name,...)
Define a condition that can be used later inside an Internal::Conditioned type.
Definition
AutoSerializedMacros.hpp:4
SERIALIZED_FIELD
#define SERIALIZED_FIELD(Name,...)
Definition
AutoSerializedMacros.hpp:77
BaseMessage.hpp
Chat.hpp
ProtocolCraft::BaseMessage
Definition
BaseMessage.hpp:11
ProtocolCraft::Chat
Definition
Chat.hpp:18
ProtocolCraft::ClientboundOpenScreenPacket
Definition
ClientboundOpenScreenPacket.hpp:9
ProtocolCraft::ClientboundOpenScreenPacket::SERIALIZED_FIELD
SERIALIZED_FIELD(ContainerId, VarInt)
ProtocolCraft::ClientboundOpenScreenPacket::SERIALIZED_FIELD
SERIALIZED_FIELD(Type, VarInt)
ProtocolCraft::ClientboundOpenScreenPacket::SERIALIZED_FIELD
SERIALIZED_FIELD(Title, Chat)
ProtocolCraft::ClientboundOpenScreenPacket::packet_name
static constexpr std::string_view packet_name
Definition
ClientboundOpenScreenPacket.hpp:11
ProtocolCraft::ClientboundOpenScreenPacket::DECLARE_READ_WRITE_SERIALIZE
DECLARE_READ_WRITE_SERIALIZE
Definition
ClientboundOpenScreenPacket.hpp:26
ProtocolCraft
Definition
ItemUtilities.hpp:8
ProtocolCraft::Internal::Conditioned
A type wrapper to conditionally serialize a type.
Definition
Templates.hpp:83
ProtocolCraft::VarType
Definition
Templates.hpp:26
protocolCraft
include
protocolCraft
Messages
Play
Clientbound
ClientboundOpenScreenPacket.hpp
Generated by
1.9.8