Botcraft 26.3
Loading...
Searching...
No Matches
ThrownTridentEntity.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 SetIdLoyalty(0);
11#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
12 SetIdFoil(false);
13#endif
14 }
15
20
21
22 std::string ThrownTridentEntity::GetName() const
23 {
24 return "trident";
25 }
26
31
32
34 {
35 return "trident";
36 }
37
42
43
45 {
47
48 output["metadata"]["id_loyalty"] = GetIdLoyalty();
49#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
50 output["metadata"]["id_foil"] = GetIdFoil();
51#endif
52
53 return output;
54 }
55
56
58 {
59 return GetMetadata<char>(BOTCRAFT_ENTITY_METADATA_INDEX("id_loyalty"));
60 }
61
62#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
64 {
65 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("id_foil"));
66 }
67#endif
68
69
70 void ThrownTridentEntity::SetIdLoyalty(const char id_loyalty)
71 {
72 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("id_loyalty"), id_loyalty);
73 }
74
75#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
76 void ThrownTridentEntity::SetIdFoil(const bool id_foil)
77 {
79 }
80#endif
81
82
84 {
85 return 0.5;
86 }
87
89 {
90 return 0.5;
91 }
92
93}
94#endif
virtual ProtocolCraft::Json::Value Serialize() const override
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
void SetIdFoil(const bool id_foil)
virtual std::string GetName() const override
void SetIdLoyalty(const char id_loyalty)
virtual double GetHeightImpl() const override
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
static constexpr int hierarchy_metadata_count
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