Botcraft 1.21.4
Loading...
Searching...
No Matches
CreakingEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
2#pragma once
3
5
6namespace Botcraft
7{
9 {
10 protected:
11#if PROTOCOL_VERSION < 769 /* < 1.21.4 */
12 static constexpr int metadata_count = 2;
13#else
14 static constexpr int metadata_count = 4;
15#endif
16 static const std::array<std::string, metadata_count> metadata_names;
18
19 public:
21 virtual ~CreakingEntity();
22
23 // Object related stuff
24 virtual std::string GetName() const override;
25 virtual EntityType GetType() const override;
26
27 // Static stuff, for easier comparison
28 static std::string GetClassName();
29 static EntityType GetClassType();
30
31
32 virtual ProtocolCraft::Json::Value Serialize() const override;
33
34 // Metadata stuff
35 virtual void SetMetadataValue(const int index, const std::any& value) override;
36
37 bool GetCanMove() const;
38 bool GetIsActive() const;
39#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
40 bool GetIsTearingDown() const;
41 const std::optional<Position>& GetHomePos() const;
42#endif
43
44 void SetCanMove(const bool can_move);
45 void SetIsActive(const bool is_active);
46#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
47 void SetIsTearingDown(const bool is_tearing_down);
48 void SetHomePos(const std::optional<Position>& home_pos);
49#endif
50
51 protected:
52 virtual double GetWidthImpl() const override;
53 virtual double GetHeightImpl() const override;
54
55 };
56}
57#endif
virtual EntityType GetType() const override
static std::string GetClassName()
virtual void SetMetadataValue(const int index, const std::any &value) override
virtual double GetWidthImpl() const override
virtual std::string GetName() const override
static constexpr int hierarchy_metadata_count
void SetHomePos(const std::optional< Position > &home_pos)
static EntityType GetClassType()
const std::optional< Position > & GetHomePos() const
virtual double GetHeightImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr int metadata_count
void SetCanMove(const bool can_move)
static const std::array< std::string, metadata_count > metadata_names
void SetIsTearingDown(const bool is_tearing_down)
void SetIsActive(const bool is_active)
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45