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#ifdef LL_PLAT_S
47 MCAPI ItemContext(::WeakEntityRef const& entityRef, int slot);
48#endif
49
50 MCAPI ::ItemStack const& _getItem() const;
51
52 MCAPI void _setItem(::ItemStack const& item);
53
54 MCAPI ::Container* _tryGetChestContainer() const;
55
56 MCAPI ::Container* _tryGetContainerFromEntity() const;
57
58 MCAPI ::Container* _tryGetContainerFromItem() const;
59
60 MCAPI bool clearAllDynamicProperties(::std::string const& collection);
61
62 MCAPI ::std::optional<::std::vector<::std::string>> getDynamicPropertyIds(::std::string const& collection) const;
63
64 MCAPI ::std::optional<::std::vector<::std::string>> getLore() const;
65
66 MCAPI bool isValid() const;
67
68 MCAPI bool setAmount(int amount);
69
70 MCAPI ::std::optional<bool> setCanDestroy(::std::vector<::std::string> const& blockIdentifiers);
71
72 MCAPI ::std::optional<bool> setCanPlaceOn(::std::vector<::std::string> const& blockIdentifiers);
73
74 MCAPI bool setDynamicProperty(
75 ::std::string const& collection,
76 ::std::string const& key,
77 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
78 );
79
80 MCAPI bool setKeepOnDeath(bool value);
81
82 MCAPI bool setLockMode(::ItemLockMode lockMode);
83
84 MCAPI bool setLore(::std::optional<::std::vector<::std::string>> const& loreList);
85
86 MCAPI bool setNameTag(::std::optional<::std::string> nameTag);
87
88 MCAPI ~ItemContext();
89 // NOLINTEND
90
91public:
92 // static functions
93 // NOLINTBEGIN
94 MCAPI static bool
95 _trySetEquippedSlot(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
96
97 MCAPI static bool
98 setEquipment(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
99 // NOLINTEND
100
101public:
102 // constructor thunks
103 // NOLINTBEGIN
104 MCAPI void* $ctor(::ItemContext&&);
105
106#ifdef LL_PLAT_S
107 MCAPI void* $ctor(::WeakEntityRef const& entityRef, int slot);
108#endif
109 // NOLINTEND
110
111public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCAPI void $dtor();
115 // NOLINTEND
116};
Definition BlockSource.h:71
Definition Container.h:33
Definition ItemStack.h:26
Definition Mob.h:51
Definition Vec3.h:10
Definition WeakEntityRef.h:14