1#if PROTOCOL_VERSION > 340
9#if PROTOCOL_VERSION < 770
14#if PROTOCOL_VERSION < 770
24#if PROTOCOL_VERSION < 770
29#if PROTOCOL_VERSION < 770
38#if PROTOCOL_VERSION > 765
75#if PROTOCOL_VERSION < 770
76 output[
"metadata"][
"home_pos"] = GetHomePos().Serialize();
78 output[
"metadata"][
"has_egg"] =
GetHasEgg();
80#if PROTOCOL_VERSION < 770
81 output[
"metadata"][
"travel_pos"] = GetTravelPos().Serialize();
82 output[
"metadata"][
"going_home"] = GetGoingHome();
83 output[
"metadata"][
"travelling"] = GetTravelling();
103#if PROTOCOL_VERSION < 770
104 Position TurtleEntity::GetHomePos()
const
107 return std::any_cast<Position>(
metadata.at(
"home_pos"));
114 return std::any_cast<bool>(
metadata.at(
"has_egg"));
120 return std::any_cast<bool>(
metadata.at(
"laying_egg"));
123#if PROTOCOL_VERSION < 770
124 Position TurtleEntity::GetTravelPos()
const
127 return std::any_cast<Position>(
metadata.at(
"travel_pos"));
130 bool TurtleEntity::GetGoingHome()
const
133 return std::any_cast<bool>(
metadata.at(
"going_home"));
136 bool TurtleEntity::GetTravelling()
const
139 return std::any_cast<bool>(
metadata.at(
"travelling"));
144#if PROTOCOL_VERSION < 770
145 void TurtleEntity::SetHomePos(
const Position& home_pos)
161 metadata[
"laying_egg"] = laying_egg;
164#if PROTOCOL_VERSION < 770
165 void TurtleEntity::SetTravelPos(
const Position& travel_pos)
168 metadata[
"travel_pos"] = travel_pos;
171 void TurtleEntity::SetGoingHome(
const bool going_home)
174 metadata[
"going_home"] = going_home;
177 void TurtleEntity::SetTravelling(
const bool travelling)
180 metadata[
"travelling"] = travelling;
virtual void SetMetadataValue(const int index, const std::any &value) override
virtual ProtocolCraft::Json::Value Serialize() const override
std::shared_mutex entity_mutex
std::map< std::string, std::any > metadata
std::map< EntityAttribute::Type, EntityAttribute > attributes
static EntityType GetClassType()
static constexpr int metadata_count
virtual double GetHeightImpl() const override
bool GetLayingEgg() const
virtual void SetMetadataValue(const int index, const std::any &value) override
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetLayingEgg(const bool laying_egg)
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
static const std::array< std::string, metadata_count > metadata_names
void SetHasEgg(const bool has_egg)
virtual std::string GetName() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...