Botcraft 26.3
Loading...
Searching...
No Matches
AbstractBoatEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
13 }
14
19
20
22 {
23 return true;
24 }
25
26
28 {
30
31 output["metadata"]["data_id_paddle_left"] = GetDataIdPaddleLeft();
32 output["metadata"]["data_id_paddle_right"] = GetDataIdPaddleRight();
33 output["metadata"]["data_id_bubble_time"] = GetDataIdBubbleTime();
34
35
36 return output;
37 }
38
39
41 {
42 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_paddle_left"));
43 }
44
46 {
47 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_paddle_right"));
48 }
49
51 {
52 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_bubble_time"));
53 }
54
55
56 void AbstractBoatEntity::SetDataIdPaddleLeft(const bool data_id_paddle_left)
57 {
58 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_paddle_left"), data_id_paddle_left);
59 }
60
61 void AbstractBoatEntity::SetDataIdPaddleRight(const bool data_id_paddle_right)
62 {
63 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_paddle_right"), data_id_paddle_right);
64 }
65
66 void AbstractBoatEntity::SetDataIdBubbleTime(const int data_id_bubble_time)
67 {
68 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_bubble_time"), data_id_bubble_time);
69 }
70}
71#endif
void SetDataIdPaddleRight(const bool data_id_paddle_right)
static constexpr int metadata_count
void SetDataIdBubbleTime(const int data_id_bubble_time)
virtual bool IsAbstractBoat() const override
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataIdPaddleLeft(const bool data_id_paddle_left)
static constexpr int hierarchy_metadata_count
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
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