Botcraft
1.21.4
Loading...
Searching...
No Matches
ClientboundRespawnPacket.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
protocolCraft/BaseMessage.hpp
"
4
#if PROTOCOL_VERSION < 764
/* < 1.20.2 */
5
#include "
protocolCraft/Types/Identifier.hpp
"
6
#endif
7
#if PROTOCOL_VERSION > 747
/* > 1.16.1 */
&& PROTOCOL_VERSION < 759
/* < 1.19 */
8
#include "
protocolCraft/Types/NBT/NBT.hpp
"
9
#endif
10
#if PROTOCOL_VERSION > 758
/* > 1.18.2 */
&& PROTOCOL_VERSION < 764
/* < 1.20.2 */
11
#include "
protocolCraft/Types/GlobalPos.hpp
"
12
#endif
13
#if PROTOCOL_VERSION > 763
/* > 1.20.1 */
14
#include "
protocolCraft/Types/CommonPlayerSpawnInfo.hpp
"
15
#endif
16
17
18
namespace
ProtocolCraft
19
{
20
class
ClientboundRespawnPacket
:
public
BaseMessage
<ClientboundRespawnPacket>
21
{
22
public
:
23
static
constexpr
std::string_view
packet_name
=
"Respawn"
;
24
25
#if PROTOCOL_VERSION < 477
/* < 1.14 */
26
SERIALIZED_FIELD
(
Dimension
,
int
);
27
SERIALIZED_FIELD
(Difficulty,
unsigned
char
);
28
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
29
SERIALIZED_FIELD
(LevelType, std::string);
30
#elif PROTOCOL_VERSION < 573
/* < 1.15 */
31
SERIALIZED_FIELD
(
Dimension
,
int
);
32
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
33
SERIALIZED_FIELD
(LevelType, std::string);
34
#elif PROTOCOL_VERSION < 735
/* < 1.16 */
35
SERIALIZED_FIELD
(
Dimension
,
int
);
36
SERIALIZED_FIELD
(Seed,
long
long
int
);
37
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
38
SERIALIZED_FIELD
(LevelType, std::string);
39
#elif PROTOCOL_VERSION < 751
/* < 1.16.2 */
40
SERIALIZED_FIELD
(
Dimension
,
Identifier
);
41
SERIALIZED_FIELD
(Seed,
long
long
int
);
42
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
43
SERIALIZED_FIELD
(PreviousPlayerGameType,
unsigned
char
);
44
SERIALIZED_FIELD
(IsDebug,
bool
);
45
SERIALIZED_FIELD
(IsFlat,
bool
);
46
SERIALIZED_FIELD
(KeepAllPlayerData,
bool
);
47
#elif PROTOCOL_VERSION < 759
/* < 1.19 */
48
SERIALIZED_FIELD
(DimensionType,
NBT::UnnamedValue
);
49
SERIALIZED_FIELD
(
Dimension
,
Identifier
);
50
SERIALIZED_FIELD
(Seed,
long
long
int
);
51
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
52
SERIALIZED_FIELD
(PreviousPlayerGameType,
unsigned
char
);
53
SERIALIZED_FIELD
(IsDebug,
bool
);
54
SERIALIZED_FIELD
(IsFlat,
bool
);
55
SERIALIZED_FIELD
(KeepAllPlayerData,
bool
);
56
#elif PROTOCOL_VERSION < 761
/* < 1.19.3 */
57
SERIALIZED_FIELD
(DimensionType,
Identifier
);
58
SERIALIZED_FIELD
(
Dimension
,
Identifier
);
59
SERIALIZED_FIELD
(Seed,
long
long
int
);
60
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
61
SERIALIZED_FIELD
(PreviousPlayerGameType,
unsigned
char
);
62
SERIALIZED_FIELD
(IsDebug,
bool
);
63
SERIALIZED_FIELD
(IsFlat,
bool
);
64
SERIALIZED_FIELD
(KeepAllPlayerData,
bool
);
65
SERIALIZED_FIELD
(LastDeathLocation, std::optional<GlobalPos>);
66
#elif PROTOCOL_VERSION < 763
/* < 1.20 */
67
SERIALIZED_FIELD
(DimensionType,
Identifier
);
68
SERIALIZED_FIELD
(
Dimension
,
Identifier
);
69
SERIALIZED_FIELD
(Seed,
long
long
int
);
70
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
71
SERIALIZED_FIELD
(PreviousPlayerGameType,
unsigned
char
);
72
SERIALIZED_FIELD
(IsDebug,
bool
);
73
SERIALIZED_FIELD
(IsFlat,
bool
);
74
SERIALIZED_FIELD
(DataToKeep,
unsigned
char
);
75
SERIALIZED_FIELD
(LastDeathLocation, std::optional<GlobalPos>);
76
#elif PROTOCOL_VERSION < 764
/* < 1.20.2 */
77
SERIALIZED_FIELD
(DimensionType,
Identifier
);
78
SERIALIZED_FIELD
(
Dimension
,
Identifier
);
79
SERIALIZED_FIELD
(Seed,
long
long
int
);
80
SERIALIZED_FIELD
(PlayerGameType,
unsigned
char
);
81
SERIALIZED_FIELD
(PreviousPlayerGameType,
unsigned
char
);
82
SERIALIZED_FIELD
(IsDebug,
bool
);
83
SERIALIZED_FIELD
(IsFlat,
bool
);
84
SERIALIZED_FIELD
(DataToKeep,
unsigned
char
);
85
SERIALIZED_FIELD
(LastDeathLocation, std::optional<GlobalPos>);
86
SERIALIZED_FIELD
(PortalCooldown,
VarInt
);
87
#else
88
SERIALIZED_FIELD
(
CommonPlayerSpawnInfo
,
ProtocolCraft::CommonPlayerSpawnInfo
);
89
SERIALIZED_FIELD
(DataToKeep,
unsigned
char
);
90
#endif
91
DECLARE_READ_WRITE_SERIALIZE
;
92
};
93
}
//ProtocolCraft
SERIALIZED_FIELD
#define SERIALIZED_FIELD(Name,...)
Definition
AutoSerializedMacros.hpp:77
BaseMessage.hpp
CommonPlayerSpawnInfo.hpp
Identifier.hpp
NBT.hpp
ProtocolCraft::BaseMessage
Definition
BaseMessage.hpp:11
ProtocolCraft::ClientboundRespawnPacket
Definition
ClientboundRespawnPacket.hpp:21
ProtocolCraft::ClientboundRespawnPacket::SERIALIZED_FIELD
SERIALIZED_FIELD(CommonPlayerSpawnInfo, ProtocolCraft::CommonPlayerSpawnInfo)
ProtocolCraft::ClientboundRespawnPacket::DECLARE_READ_WRITE_SERIALIZE
DECLARE_READ_WRITE_SERIALIZE
Definition
ClientboundRespawnPacket.hpp:91
ProtocolCraft::ClientboundRespawnPacket::SERIALIZED_FIELD
SERIALIZED_FIELD(DataToKeep, unsigned char)
ProtocolCraft::ClientboundRespawnPacket::packet_name
static constexpr std::string_view packet_name
Definition
ClientboundRespawnPacket.hpp:23
ProtocolCraft::CommonPlayerSpawnInfo
Definition
CommonPlayerSpawnInfo.hpp:12
ProtocolCraft::Identifier
Definition
Identifier.hpp:8
ProtocolCraft::NBT::UnnamedValue
Definition
NBT.hpp:12
ProtocolCraft
Definition
ItemUtilities.hpp:8
ProtocolCraft::BrigadierPropertyType::Dimension
@ Dimension
GlobalPos.hpp
ProtocolCraft::VarType
Definition
Templates.hpp:26
protocolCraft
include
protocolCraft
Messages
Play
Clientbound
ClientboundRespawnPacket.hpp
Generated by
1.9.8