Botcraft 26.3
Loading...
Searching...
No Matches
ExperienceOrbEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
10 SetDataValue(0);
11#endif
12 }
13
18
19
20 std::string ExperienceOrbEntity::GetName() const
21 {
22 return "experience_orb";
23 }
24
29
30
32 {
33 return "experience_orb";
34 }
35
40
41#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
43 {
45
46 output["metadata"]["data_value"] = GetDataValue();
47
48 return output;
49 }
50
51
52
54 {
55 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_value"));
56 }
57
58
59 void ExperienceOrbEntity::SetDataValue(const int data_value)
60 {
61 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_value"), data_value);
62 }
63#endif
64
65
67 {
68 return 0.5;
69 }
70
72 {
73 return 0.5;
74 }
75
76}
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
virtual ProtocolCraft::Json::Value Serialize() const
Definition Entity.cpp:1246
std::vector< std::any > metadata
Definition Entity.hpp:335
virtual ProtocolCraft::Json::Value Serialize() const override
virtual double GetHeightImpl() const override
void SetDataValue(const int data_value)
virtual std::string GetName() const override
static constexpr int hierarchy_metadata_count
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
#define BOTCRAFT_ENTITY_METADATA_INDEX(name)
Definition Entity.hpp:347