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