1#if PROTOCOL_VERSION > 340
30#if PROTOCOL_VERSION > 765
68 output[
"metadata"][
"has_egg"] =
GetHasEgg();
94 return std::any_cast<Position>(
metadata.at(
"home_pos"));
100 return std::any_cast<bool>(
metadata.at(
"has_egg"));
106 return std::any_cast<bool>(
metadata.at(
"laying_egg"));
112 return std::any_cast<Position>(
metadata.at(
"travel_pos"));
118 return std::any_cast<bool>(
metadata.at(
"going_home"));
124 return std::any_cast<bool>(
metadata.at(
"travelling"));
143 metadata[
"laying_egg"] = laying_egg;
149 metadata[
"travel_pos"] = travel_pos;
155 metadata[
"going_home"] = going_home;
161 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()
void SetTravelPos(const Position &travel_pos)
Position GetTravelPos() const
void SetGoingHome(const bool going_home)
static constexpr int metadata_count
virtual double GetHeightImpl() const override
bool GetTravelling() const
bool GetLayingEgg() const
virtual void SetMetadataValue(const int index, const std::any &value) override
static std::string GetClassName()
bool GetGoingHome() const
void SetTravelling(const bool travelling)
static constexpr int hierarchy_metadata_count
void SetHomePos(const Position &home_pos)
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
Position GetHomePos() const
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...
ProtocolCraft::Json::Value Serialize() const