Botcraft 1.21.4
Loading...
Searching...
No Matches
ServerboundMovePlayerPacketPosRot.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace ProtocolCraft
6{
7 class ServerboundMovePlayerPacketPosRot : public BaseMessage<ServerboundMovePlayerPacketPosRot>
8 {
9 public:
10 static constexpr std::string_view packet_name = "Move Player PosRot";
11
12 SERIALIZED_FIELD(X, double);
13 SERIALIZED_FIELD(Y, double);
14 SERIALIZED_FIELD(Z, double);
15 SERIALIZED_FIELD(YRot, float);
16 SERIALIZED_FIELD(XRot, float);
17#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
18 SERIALIZED_FIELD(OnGround, bool);
19#else
21
22 public:
23 bool GetOnGround() const { return Flags[0]; }
24 bool GetHorizontalCollision() const { return Flags[1]; }
25 THIS& SetOnGround(const bool b) { Flags.set(0, b); return *this; }
26 THIS& SetHorizontalCollision(const bool b) { Flags.set(1, b); return *this; }
27#endif
28
30 };
31} //ProtocolCraft
#define SERIALIZED_FIELD(Name,...)
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Flags, std::bitset< 2 >)