Botcraft 26.3
Loading...
Searching...
No Matches
DolphinEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
2#pragma once
3
4#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
6#else
8#endif
9
10namespace Botcraft
11{
12#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
13 class DolphinEntity : public WaterAnimalEntity
14#else
16#endif
17 {
18 private:
19 static constexpr std::array metadata_names{
20#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
21 std::string_view("treasure_pos"),
22#endif
23 std::string_view("got_fish"),
24 std::string_view("moistness_level"),
25 };
26 protected:
27 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
28#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
30#else
32#endif
33
34 public:
36 virtual ~DolphinEntity();
37
38 // Object related stuff
39 virtual std::string GetName() const override;
40 virtual EntityType GetType() const override;
41
42 // Static stuff, for easier comparison
43 static std::string GetClassName();
44 static EntityType GetClassType();
45
46
47 virtual ProtocolCraft::Json::Value Serialize() const override;
48
49 // Metadata stuff
50#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
51 Position GetTreasurePos() const;
52#endif
53 bool GetGotFish() const;
54 int GetMoistnessLevel() const;
55
56#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
57 void SetTreasurePos(const Position& treasure_pos);
58#endif
59 void SetGotFish(const bool got_fish);
60 void SetMoistnessLevel(const int moistness_level);
61
62 // Attribute stuff
63 double GetAttributeAttackDamageValue() const;
64
65 protected:
66 virtual double GetWidthImpl() const override;
67 virtual double GetHeightImpl() const override;
68
69 };
70}
71#endif
virtual EntityType GetType() const override
double GetAttributeAttackDamageValue() const
virtual std::string GetName() const override
static constexpr int metadata_count
virtual double GetWidthImpl() const override
static EntityType GetClassType()
static constexpr std::array metadata_names
virtual double GetHeightImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr int hierarchy_metadata_count
void SetMoistnessLevel(const int moistness_level)
void SetGotFish(const bool got_fish)
static std::string GetClassName()
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