Botcraft 26.3
Loading...
Searching...
No Matches
PhantomEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
10 SetIdSize(0);
11 }
12
17
18
19 std::string PhantomEntity::GetName() const
20 {
21 return "phantom";
22 }
23
28
29
31 {
32 return "phantom";
33 }
34
39
40
42 {
43#if PROTOCOL_VERSION < 771 /* < 1.21.6 */
44 ProtocolCraft::Json::Value output = FlyingMobEntity::Serialize();
45#else
47#endif
48
49 output["metadata"]["id_size"] = GetIdSize();
50
51 return output;
52 }
53
54
56 {
57 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("id_size"));
58 }
59
60
61 void PhantomEntity::SetIdSize(const int id_size)
62 {
64 }
65
66
68 {
69 return 0.9;
70 }
71
73 {
74 return 0.5;
75 }
76
77}
78#endif
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
virtual ProtocolCraft::Json::Value Serialize() const override
Definition MobEntity.cpp:29
virtual EntityType GetType() const override
static constexpr int metadata_count
virtual double GetHeightImpl() const override
virtual double GetWidthImpl() const override
static std::string GetClassName()
virtual std::string GetName() const override
static constexpr int hierarchy_metadata_count
void SetIdSize(const int id_size)
static EntityType GetClassType()
virtual ProtocolCraft::Json::Value Serialize() 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