Botcraft 26.3
Loading...
Searching...
No Matches
EyeOfEnderEntity.cpp
Go to the documentation of this file.
2
3#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
5#endif
6
7namespace Botcraft
8{
10 {
11 // Initialize all metadata with default values
13#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
14#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
16#else
17 const static int item_id = AssetsManager::getInstance().GetItemID("minecraft:ender_eye");
18 ProtocolCraft::Slot default_slot;
19 default_slot.SetItemId(item_id);
20 default_slot.SetItemCount(1);
21 SetDataItemStack(default_slot);
22#endif
23#endif
24 }
25
30
31
32 std::string EyeOfEnderEntity::GetName() const
33 {
34 return "eye_of_ender";
35 }
36
41
42
44 {
45 return "eye_of_ender";
46 }
47
52
53
54#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
56 {
58
59 output["metadata"]["data_item_stack"] = GetDataItemStack().Serialize();
60
61 return output;
62 }
63
64
66 {
67 return GetMetadata<ProtocolCraft::Slot>(BOTCRAFT_ENTITY_METADATA_INDEX("data_item_stack"));
68 }
69
70
72 {
73 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_item_stack"), data_item_stack);
74 }
75#endif
76
77
79 {
80 return 0.25;
81 }
82
84 {
85 return 0.25;
86 }
87
88}
static AssetsManager & getInstance()
ItemId GetItemID(const std::string &item_name) const
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
virtual ProtocolCraft::Json::Value Serialize() const
Definition Entity.cpp:1246
std::vector< std::any > metadata
Definition Entity.hpp:335
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
virtual std::string GetName() const override
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr int hierarchy_metadata_count
void SetDataItemStack(const ProtocolCraft::Slot &data_item_stack)
static EntityType GetClassType()
virtual double GetHeightImpl() const override
ProtocolCraft::Slot GetDataItemStack() const
static constexpr int metadata_count
static std::string GetClassName()
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
virtual Json::Value Serialize() const
#define BOTCRAFT_ENTITY_METADATA_INDEX(name)
Definition Entity.hpp:347