LeviLamina
Loading...
Searching...
No Matches
ItemContext.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/ecs/WeakEntityRef.h"
7#include "mc/deps/shared_types/legacy/EquipmentSlot.h"
8#include "mc/world/item/ItemContextType.h"
9#include "mc/world/item/ItemLockMode.h"
10#include "mc/world/item/ItemStack.h"
11#include "mc/world/level/BlockPos.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockSource;
16class Container;
17class Mob;
18class Vec3;
19// clang-format on
20
21class ItemContext {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<4, 4, ::ItemContextType> mItemContextType;
26 ::ll::TypedStorage<8, 8, ::Container*> mContainer;
27 ::ll::TypedStorage<4, 4, int> mSlot;
28 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::EquipmentSlot> mEquipmentSlot;
29 ::ll::TypedStorage<8, 8, ::BlockSource*> mBlockSource;
30 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
31 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mEntityRef;
32 ::ll::TypedStorage<8, 160, ::std::optional<::ItemStack>> mItemStackContainer;
33 // NOLINTEND
34
35public:
36 // prevent constructor by default
37 ItemContext& operator=(ItemContext const&);
38 ItemContext(ItemContext const&);
39 ItemContext();
40
41public:
42 // member functions
43 // NOLINTBEGIN
44 MCAPI ItemContext(::ItemContext&&);
45
46 MCAPI ItemContext(::WeakEntityRef const& entityRef, int slot);
47
48 MCAPI ::ItemStack const& _getItem() const;
49
50 MCAPI void _setItem(::ItemStack const& item);
51
52 MCAPI ::Container* _tryGetChestContainer() const;
53
54 MCAPI ::Container* _tryGetContainerFromEntity() const;
55
56 MCAPI ::Container* _tryGetContainerFromItem() const;
57
58 MCAPI bool clearAllDynamicProperties(::std::string const& collection);
59
60 MCAPI ::std::optional<::std::vector<::std::string>> getDynamicPropertyIds(::std::string const& collection) const;
61
62 MCAPI ::std::optional<::std::vector<::std::string>> getLore() const;
63
64 MCAPI bool isValid() const;
65
66 MCAPI bool setAmount(int amount);
67
68 MCAPI ::std::optional<bool> setCanDestroy(::std::vector<::std::string> const& blockIdentifiers);
69
70 MCAPI ::std::optional<bool> setCanPlaceOn(::std::vector<::std::string> const& blockIdentifiers);
71
72 MCAPI bool setDynamicProperty(
73 ::std::string const& collection,
74 ::std::string const& key,
75 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
76 );
77
78 MCAPI bool setKeepOnDeath(bool value);
79
80 MCAPI bool setLockMode(::ItemLockMode lockMode);
81
82 MCAPI bool setLore(::std::optional<::std::vector<::std::string>> const& loreList);
83
84 MCAPI bool setNameTag(::std::optional<::std::string> nameTag);
85
86 MCAPI ~ItemContext();
87 // NOLINTEND
88
89public:
90 // static functions
91 // NOLINTBEGIN
92 MCAPI static bool
93 _trySetEquippedSlot(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
94
95 MCAPI static bool
96 setEquipment(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102 MCAPI void* $ctor(::ItemContext&&);
103
104 MCAPI void* $ctor(::WeakEntityRef const& entityRef, int slot);
105 // NOLINTEND
106
107public:
108 // destructor thunk
109 // NOLINTBEGIN
110 MCAPI void $dtor();
111 // NOLINTEND
112};
Definition BlockSource.h:68
Definition Container.h:33
Definition ItemStack.h:26
Definition Mob.h:50
Definition Vec3.h:10
Definition WeakEntityRef.h:14