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 ItemStackBase;
18class Mob;
19class Vec3;
20struct ItemTag;
21// clang-format on
22
23class ItemContext {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<4, 4, ::ItemContextType> mItemContextType;
28 ::ll::TypedStorage<8, 8, ::Container*> mContainer;
29 ::ll::TypedStorage<4, 4, int> mSlot;
30 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::EquipmentSlot> mEquipmentSlot;
31 ::ll::TypedStorage<8, 8, ::BlockSource*> mBlockSource;
32 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
33 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mEntityRef;
34 ::ll::TypedStorage<8, 160, ::std::optional<::ItemStack>> mItemStackContainer;
35 // NOLINTEND
36
37public:
38 // prevent constructor by default
39 ItemContext(ItemContext const&);
40 ItemContext();
41
42public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI ItemContext(::WeakEntityRef const& entityRef, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot);
46
47 MCAPI ItemContext(::WeakEntityRef const& entityRef, int slot);
48
49 MCAPI ItemContext(::ItemStack const& item, int slot);
50
51 MCAPI ItemContext(::BlockSource& region, ::BlockPos const& containerPos, int slot);
52
53 MCAPI ::Container* _tryGetContainerFromEntity() const;
54
55 MCAPI ::Container* _tryGetContainerFromItem() const;
56
57 MCAPI bool clearAllDynamicProperties(::std::string const& collection);
58
59 MCAPI ::std::optional<int> getAmount() const;
60
61 MCAPI ::std::optional<::std::vector<::std::string>> getCanDestroy() const;
62
63 MCAPI ::std::optional<::std::vector<::std::string>> getCanPlaceOn() const;
64
65 MCAPI ::Container const* getContainer() const;
66
67 MCAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
68 getDynamicProperty(::std::string const& collection, ::std::string const& key) const;
69
70 MCAPI ::std::optional<::std::vector<::std::string>> getDynamicPropertyIds(::std::string const& collection) const;
71
72 MCAPI ::std::optional<uint64> getDynamicPropertyTotalByteCount(::std::string const& collection) const;
73
74 MCAPI ::std::optional<::std::string> getId() const;
75
76 MCAPI ::std::optional<::ItemStack> getItem() const;
77
78 MCAPI ::std::optional<bool> getKeepOnDeath() const;
79
80 MCAPI ::std::optional<::ItemLockMode> getLockMode() const;
81
82 MCAPI ::std::optional<::std::vector<::std::string>> getLore() const;
83
84 MCAPI ::std::optional<int> getMaxAmount() const;
85
86 MCAPI ::std::optional<::std::string> getNameTag() const;
87
88 MCAPI int getSlot() const;
89
90 MCAPI ::std::optional<::std::vector<::ItemTag>> getTags() const;
91
92 MCAPI ::std::optional<bool> hasItem() const;
93
94 MCAPI ::std::optional<bool> hasTag(::ItemTag const& tag) const;
95
96 MCAPI ::std::optional<bool> isStackable() const;
97
98 MCAPI ::std::optional<bool> isStackableWith(::ItemStackBase const& other) const;
99
100 MCAPI bool isValid() const;
101
102 MCAPI ::ItemContext& operator=(::ItemContext&&);
103
104 MCAPI ::ItemContext& operator=(::ItemContext const&);
105
106 MCAPI bool setAmount(int amount);
107
108 MCAPI ::std::optional<bool> setCanDestroy(::std::vector<::std::string> const& blockIdentifiers);
109
110 MCAPI ::std::optional<bool> setCanPlaceOn(::std::vector<::std::string> const& blockIdentifiers);
111
112 MCAPI bool setDynamicProperty(
113 ::std::string const& collection,
114 ::std::string const& key,
115 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
116 );
117
118 MCAPI bool setItem(::ItemStack const& stack);
119
120 MCAPI bool setKeepOnDeath(bool value);
121
122 MCAPI bool setLockMode(::ItemLockMode lockMode);
123
124 MCAPI bool setLore(::std::optional<::std::vector<::std::string>> const& loreList);
125
126 MCAPI bool setNameTag(::std::optional<::std::string> nameTag);
127
128 MCAPI ~ItemContext();
129 // NOLINTEND
130
131public:
132 // static functions
133 // NOLINTBEGIN
134 MCAPI static bool
135 _trySetEquippedSlot(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
136
137 MCAPI static ::ItemContext createPlayerEnderInventoryContext(::WeakEntityRef const& entityRef, int slot);
138
139 MCAPI static bool
140 setEquipment(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
141 // NOLINTEND
142
143public:
144 // constructor thunks
145 // NOLINTBEGIN
146 MCAPI void* $ctor(::WeakEntityRef const& entityRef, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot);
147
148 MCAPI void* $ctor(::WeakEntityRef const& entityRef, int slot);
149
150 MCAPI void* $ctor(::ItemStack const& item, int slot);
151
152 MCAPI void* $ctor(::BlockSource& region, ::BlockPos const& containerPos, int slot);
153 // NOLINTEND
154
155public:
156 // destructor thunk
157 // NOLINTBEGIN
158 MCAPI void $dtor();
159 // NOLINTEND
160};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Container.h:34
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Mob.h:57
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition ItemTag.h:8