5#if PROTOCOL_VERSION > 776
17 static constexpr std::string_view
packet_name =
"Move Entity Pos";
19#if PROTOCOL_VERSION > 776
28 std::vector<std::pair<int, std::array<short, 3>>> deltas(step_count);
29 for (
int i = 0; i < step_count; ++i)
31 deltas[i].first = ReadData<VarInt>(iter, length);
32 deltas[i].second = ReadData<std::array<short, 3>>(iter, length);
41 if (stepped_deltas_.has_value())
43 const std::vector<std::pair<int, std::array<short, 3>>>& v = stepped_deltas_.value();
44 for (
size_t i = 0; i < v.size(); ++i)
46 WriteData<VarInt>(v[i].first, c);
47 WriteData<std::array<short, 3>>(v[i].second, c);
54#if PROTOCOL_VERSION < 107
59#elif PROTOCOL_VERSION < 777
70#if PROTOCOL_VERSION > 776
74 return static_cast<bool>(Properties & 1);
79 Properties = (Properties & ~1) |
static_cast<int>(b);
85 return Properties >> 1;
90 Properties = (Properties & 1) | (i << 1);
#define SERIALIZED_FIELD(Name,...)
THIS & SetOnGround(const bool b)
SERIALIZED_FIELD(EntityId, VarInt)
DEFINE_CONDITION(IsSingleStep, GetStepCount()<=0)
void WriteStepped(const std::optional< std::vector< std::pair< int, std::array< short, 3 > > > > &stepped_deltas_, WriteContainer &c) const
static constexpr std::string_view packet_name
SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Properties, VarInt)
SERIALIZED_FIELD(SingleDelta, Internal::Conditioned< std::array< short, 3 >, &THIS::IsSingleStep >)
DECLARE_READ_WRITE_SERIALIZE
std::optional< std::vector< std::pair< int, std::array< short, 3 > > > > ReadStepped(ReadIterator &iter, size_t &length) const
THIS & SetStepCount(const int i)
SERIALIZED_FIELD(SteppedDeltas, Internal::CustomType< std::optional< std::vector< std::pair< int, std::array< short, 3 > > > >, &THIS::ReadStepped, &THIS::WriteStepped, nullptr >)
std::vector< unsigned char > WriteContainer
std::vector< unsigned char >::const_iterator ReadIterator
A type wrapper to conditionally serialize a type.