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