Botcraft 26.3
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 private:
11 static constexpr std::array metadata_names{
12 std::string_view("can_move"),
13 std::string_view("is_active"),
14#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
15 std::string_view("is_tearing_down"),
16 std::string_view("home_pos"),
17#endif
18 };
19 protected:
20 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
22
23 public:
25 virtual ~CreakingEntity();
26
27 // Object related stuff
28 virtual std::string GetName() const override;
29 virtual EntityType GetType() const override;
30
31 // Static stuff, for easier comparison
32 static std::string GetClassName();
33 static EntityType GetClassType();
34
35
36 virtual ProtocolCraft::Json::Value Serialize() const override;
37
38 // Metadata stuff
39 bool GetCanMove() const;
40 bool GetIsActive() const;
41#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
42 bool GetIsTearingDown() const;
43 std::optional<Position> GetHomePos() const;
44#endif
45
46 void SetCanMove(const bool can_move);
47 void SetIsActive(const bool is_active);
48#if PROTOCOL_VERSION > 768 /* > 1.21.3 */
49 void SetIsTearingDown(const bool is_tearing_down);
50 void SetHomePos(const std::optional<Position>& home_pos);
51#endif
52
53 protected:
54 virtual double GetWidthImpl() const override;
55 virtual double GetHeightImpl() const override;
56
57 };
58}
59#endif
std::optional< Position > GetHomePos() const
virtual EntityType GetType() const override
static std::string GetClassName()
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()
static constexpr std::array metadata_names
virtual double GetHeightImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr int metadata_count
void SetCanMove(const bool can_move)
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