Botcraft 26.3
Loading...
Searching...
No Matches
ThrownPotionEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
2#pragma once
3
4#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
6#else
9#endif
10
11namespace Botcraft
12{
13#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
14 class ThrownPotionEntity : public ThrowableItemProjectileEntity
15#else
16 class ThrownPotionEntity : public ThrowableProjectileEntity
17#endif
18 {
19#if PROTOCOL_VERSION < 579 /* < 1.16 */
20 private:
21 static constexpr std::array metadata_names{
22 std::string_view("data_item_stack"),
23 };
24#endif
25 protected:
26#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
27 static constexpr int metadata_count = 0;
28 static constexpr int hierarchy_metadata_count = ThrowableItemProjectileEntity::metadata_count + ThrowableItemProjectileEntity::hierarchy_metadata_count;
29#else
30 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
31 static constexpr int hierarchy_metadata_count = ThrowableProjectileEntity::metadata_count + ThrowableProjectileEntity::hierarchy_metadata_count;
32#endif
33 public:
34 ThrownPotionEntity();
35 virtual ~ThrownPotionEntity();
36
37 // Object related stuff
38 virtual std::string GetName() const override;
39 virtual EntityType GetType() const override;
40
41 // Static stuff, for easier comparison
42 static std::string GetClassName();
43 static EntityType GetClassType();
44
45
46#if PROTOCOL_VERSION < 579 /* < 1.16 */
47 virtual ProtocolCraft::Json::Value Serialize() const override;
48
49 // Metadata stuff
50 ProtocolCraft::Slot GetDataItemStack() const;
51
52 void SetDataItemStack(const ProtocolCraft::Slot& data_item_stack);
53#endif
54
55 protected:
56 virtual double GetWidthImpl() const override;
57 virtual double GetHeightImpl() const override;
58
59 };
60}
61#endif
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45