Botcraft 1.21.5
Loading...
Searching...
No Matches
TurtleEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
2#pragma once
3
5
6namespace Botcraft
7{
9 {
10 protected:
11#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
12 static constexpr int metadata_count = 6;
13#else
14 static constexpr int metadata_count = 2;
15#endif
16 static const std::array<std::string, metadata_count> metadata_names;
18
19 public:
21 virtual ~TurtleEntity();
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#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
38 Position GetHomePos() const;
39#endif
40 bool GetHasEgg() const;
41 bool GetLayingEgg() const;
42#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
43 Position GetTravelPos() const;
44 bool GetGoingHome() const;
45 bool GetTravelling() const;
46#endif
47
48#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
49 void SetHomePos(const Position& home_pos);
50#endif
51 void SetHasEgg(const bool has_egg);
52 void SetLayingEgg(const bool laying_egg);
53#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
54 void SetTravelPos(const Position& travel_pos);
55 void SetGoingHome(const bool going_home);
56 void SetTravelling(const bool travelling);
57#endif
58
59 protected:
60 virtual double GetWidthImpl() const override;
61 virtual double GetHeightImpl() const override;
62
63 };
64}
65#endif
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
static constexpr int metadata_count
virtual double GetHeightImpl() const override
virtual void SetMetadataValue(const int index, const std::any &value) override
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetLayingEgg(const bool laying_egg)
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
static const std::array< std::string, metadata_count > metadata_names
void SetHasEgg(const bool has_egg)
virtual std::string GetName() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45