Botcraft 26.3
Loading...
Searching...
No Matches
SalmonEntity.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#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
11 private:
12 static constexpr std::array metadata_names{
13 std::string_view("data_type"),
14 };
15#endif
16 protected:
17#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
18 static constexpr int metadata_count = 0;
19#else
20 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
21#endif
23
24 public:
26 virtual ~SalmonEntity();
27
28 // Object related stuff
29 virtual std::string GetName() const override;
30 virtual EntityType GetType() const override;
31
32 // Static stuff, for easier comparison
33 static std::string GetClassName();
34 static EntityType GetClassType();
35
36#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
37 virtual ProtocolCraft::Json::Value Serialize() const override;
38
39 // Metadata stuff
40#if PROTOCOL_VERSION < 769 /* < 1.21.4 */
41 std::string GetDataType() const;
42 void SetDataType(const std::string& data_type);
43#else
44 int GetDataType() const;
45 void SetDataType(const int data_type);
46#endif
47#endif
48
49 protected:
50#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
51 void OnMetadataChangedImpl(const int index) override;
52#if PROTOCOL_VERSION < 769 /* < 1.21.4 */
53 const std::string& GetDataTypeImpl() const;
54#else
55 int GetDataTypeImpl() const;
56#endif
57 double GetScaleImpl() const;
58#endif
59 virtual double GetWidthImpl() const override;
60 virtual double GetHeightImpl() const override;
61
62 };
63}
64#endif
double GetScaleImpl() const
virtual ProtocolCraft::Json::Value Serialize() const override
void OnMetadataChangedImpl(const int index) override
static constexpr int metadata_count
static constexpr std::array metadata_names
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
virtual double GetHeightImpl() const override
virtual double GetWidthImpl() const override
virtual std::string GetName() const override
static std::string GetClassName()
void SetDataType(const int data_type)
virtual EntityType GetType() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45