LeviLamina
Loading...
Searching...
No Matches
ItemStackBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/world/level/Tick.h"
5
6// auto generated inclusion list
7#include "mc/common/WeakPtr.h"
8#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
9#include "mc/world/level/Tick.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
14class Block;
15class BlockType;
16class ComponentItem;
17class CompoundTag;
20class HashedString;
21class Item;
22class ItemDescriptor;
23class ItemEnchants;
24class ItemInstance;
26class RenderParams;
27class SaveContext;
28class Vec3;
29namespace Bedrock::Safety { class RedactableString; }
30namespace Json { class Value; }
31namespace mce { class Color; }
32// clang-format on
33
35public:
36 // ItemStackBase inner types declare
37 // clang-format off
38 struct ComparisonOptions;
39 // clang-format on
40
41 // ItemStackBase inner types define
43 public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<1, 1, bool> mCompareAux;
47 ::ll::TypedStorage<1, 1, bool> mCompareRelevantUserData;
48 ::ll::TypedStorage<1, 1, bool> mCompareDamage;
49 // NOLINTEND
50 };
51
52public:
53 LLNDAPI std::string getTypeName() const;
54 LLNDAPI std::string getDescriptionName() const;
55 LLNDAPI bool isEnchanted() const;
56 LLNDAPI bool removeEnchants() const;
57
58public:
59 // member variables
60 // NOLINTBEGIN
62 ::std::unique_ptr<::CompoundTag> mUserData;
63 ::Block const* mBlock;
64 short mAuxValue;
65 uchar mCount;
66 bool mValid_DeprecatedSeeComment;
67 bool mShowPickUp;
68 bool mWasPickedUp;
69 ::std::chrono::steady_clock::time_point mPickupTime;
70 ::std::vector<::BlockType const*> mCanPlaceOn;
71 uint64 mCanPlaceOnHash;
72 ::std::vector<::BlockType const*> mCanDestroy;
73 uint64 mCanDestroyHash;
74 ::Tick mBlockingTick;
75 ::std::unique_ptr<::ItemInstance> mChargedItem;
76 // NOLINTEND
77
78public:
79 // virtual functions
80 // NOLINTBEGIN
81 // vIndex: 0
82 virtual ~ItemStackBase();
83
84 // vIndex: 3
85 virtual void reinit(::Item const& item, int count, int auxValue);
86
87 // vIndex: 2
88 virtual void reinit(::Block const& block, int count);
89
90 // vIndex: 1
91 virtual void reinit(::std::string_view const name, int count, int auxValue);
92
93 // vIndex: 4
94 virtual void setNull(::std::optional<::std::string> reason);
95
96 // vIndex: 5
97 virtual ::std::string toString() const;
98
99 // vIndex: 6
100 virtual ::std::string toDebugString() const;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
106 MCAPI ItemStackBase();
107
108 MCAPI explicit ItemStackBase(::RecipeIngredient const& ingredient);
109
110 MCAPI ItemStackBase(::ItemStackBase const& rhs);
111
112 MCAPI ItemStackBase(::Block const& block, int count = 1, ::CompoundTag const* _userData = nullptr);
113
114 MCAPI
115 ItemStackBase(::std::string_view name, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);
116
117 MCAPI void _addCustomUserDataCommon(::std::unique_ptr<::CompoundTag>&& tag);
118
119 MCAPI void _checkForItemWorldCompatibility();
120
121 MCAPI ::std::string _getHoverFormattingPrefix() const;
122
123 MCAPI void _loadComponents(::CompoundTag const& compoundTag);
124
125 MCAPI void _loadItem(::CompoundTag const& compoundTag);
126
127 MCAPI void _setChargedItem(::ItemInstance const& item);
128
129 MCAPI bool _setItem(int id, bool doRemap);
130
131 MCAPI void _setItemFromBlockName(::HashedString const& blockName);
132
133 MCAPI void _updateCompareHashes();
134
135 MCAPI void add(int inCount);
136
137 MCAPI bool addComponents(::Json::Value const& root, ::std::string& errorMsg);
138
139 MCAPI void addCustomUserData(::ContainerComponent const& containerComponent);
140
141 MCAPI void clearChargedItem();
142
143 MCAPI void clearCustomLore();
144
145 MCAPI ::ItemEnchants constructItemEnchantsFromUserData() const;
146
147 MCAPI ::SharedTypes::Legacy::ArmorSlot getArmorSlot() const;
148
149 MCAPI short getAuxValue() const;
150
151 MCAPI int getBaseRepairCost() const;
152
153 MCAPI ::WeakPtr<::BlockType const> const& getBlockType() const;
154
155 MCAPI ::mce::Color getColor() const;
156
157 MCAPI ::ComponentItem const* getComponentItem() const;
158
159 MCAPI ::std::vector<::std::string> getCustomLore() const;
160
161 MCAPI ::std::string getCustomName() const;
162
163 MCAPI short getDamageValue() const;
164
165 MCAPI ::std::string getDescriptionId() const;
166
167 MCAPI ::ItemDescriptor getDescriptor() const;
168
169 MCAPI ::std::unique_ptr<::DynamicProperties> getDynamicProperties() const;
170
171 MCAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
172 getDynamicProperty(::std::string const& key, ::std::string const& collectionName) const;
173
174 MCAPI ::HashedString const& getFullNameHash() const;
175
176 MCAPI short getId() const;
177
178 MCAPI int getIdAux() const;
179
180 MCAPI ::Item const* getItem() const;
181
182 MCAPI uchar getMaxStackSize() const;
183
184 MCAPI ::std::string getName() const;
185
186 MCAPI ::std::unique_ptr<::CompoundTag> getNetworkUserData() const;
187
188 MCAPI ::HashedString const& getRawNameHash() const;
189
190 MCAPI ::std::string getRawNameId() const;
191
192 MCAPI ::Bedrock::Safety::RedactableString getRedactedCustomName() const;
193
194 MCAPI ::Bedrock::Safety::RedactableString getRedactedHoverName() const;
195
196 MCAPI ::Bedrock::Safety::RedactableString getRedactedName() const;
197
198 MCAPI bool hasContainerData() const;
199
200 MCAPI bool hasCustomHoverName() const;
201
202 MCAPI bool hasSameAuxValue(::ItemStackBase const& other) const;
203
204 MCAPI bool hasSameUserData(::ItemStackBase const& other) const;
205
206 MCAPI bool hurtAndBreak(int deltaDamage, ::Actor* owner);
207
208 MCAPI void init(::BlockType const& block, int count);
209
210 MCAPI void init(int id, int count_, int aux_, bool doRemap);
211
212 MCAPI void init(::Item const& item, int count, int auxValue, ::CompoundTag const* userData, bool doRemap);
213
214 MCAPI bool isArmorItem() const;
215
216 MCAPI bool isBlock() const;
217
218 MCAPI bool isDamageableItem() const;
219
220 MCAPI bool isEnchantingBook() const;
221
222 MCAPI bool isHorseArmorItem() const;
223
224 MCAPI bool isHumanoidWearableBlockItem() const;
225
226 MCAPI bool isInstance(::HashedString const& itemName, bool useItemLookup) const;
227
228 MCAPI bool isNull() const;
229
230 MCAPI bool
231 isOneOfBlockInstances(::std::vector<::std::reference_wrapper<::HashedString const>> const& blockTypeIds) const;
232
233 MCAPI bool isOneOfInstances(
234 ::std::initializer_list<::std::reference_wrapper<::HashedString const>> items,
235 bool useItemLookup
236 ) const;
237
238 MCAPI bool isPotionItem() const;
239
240 MCAPI bool isStackable(::ItemStackBase const& other) const;
241
242 MCAPI bool isStackedByData() const;
243
244 MCFOLD bool matches(::ItemStackBase const& other) const;
245
246 MCAPI bool matchesItem(::ItemStackBase const& other) const;
247
248 MCAPI explicit operator bool() const;
249
250 MCAPI bool operator!=(::ItemStackBase const& rhs) const;
251
252 MCAPI ::ItemStackBase& operator=(::ItemStackBase const& rhs);
253
254 MCFOLD bool operator==(::ItemStackBase const& rhs) const;
255
256 MCAPI void remove(int inCount);
257
258 MCAPI void resetHoverName();
259
260 MCAPI bool sameItem(int itemId, int auxValue) const;
261
262 MCAPI ::std::unique_ptr<::CompoundTag> save(::SaveContext const& saveContext) const;
263
264 MCAPI void saveEnchantsToUserData(::ItemEnchants const& enchant);
265
266 MCAPI bool sendEventTriggered(::std::string const& event, ::RenderParams const& params);
267
268 MCAPI void set(int inCount);
269
270 MCAPI void setChargedItem(::ItemInstance const& instance, bool isSwapping);
271
272 MCAPI void setCustomLore(::std::vector<::std::string> const& lore);
273
274 MCAPI void setCustomName(::Bedrock::Safety::RedactableString const& name);
275
276 MCAPI void setDamageValue(short newDamage);
277
278 MCAPI void setDynamicProperty(
279 ::std::string const& key,
280 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value,
281 ::std::string const& collectionName
282 );
283
284 MCAPI void setRepairCost(int cost);
285
286 MCAPI void setStackSize(uchar inCount);
287
288 MCAPI void setUserData(::std::unique_ptr<::CompoundTag> tag);
289
290 MCAPI bool updateComponent(::std::string const& name, ::Json::Value const& data);
291 // NOLINTEND
292
293public:
294 // static functions
295 // NOLINTBEGIN
296 MCAPI static bool
297 _loadBlocksForCanPlaceOnCanDestroy(::std::vector<::BlockType const*>& blockList, ::std::string const& blockName);
298 // NOLINTEND
299
300public:
301 // static variables
302 // NOLINTBEGIN
303 MCAPI static ::std::string const& TAG_CAN_DESTROY();
304
305 MCAPI static ::std::string const& TAG_CAN_PLACE_ON();
306
307 MCAPI static ::std::string const& TAG_CHARGED_ITEM();
308
309 MCAPI static ::std::string const& TAG_DISPLAY();
310
311 MCAPI static ::std::string const& TAG_DISPLAY_FILTERED_NAME();
312
313 MCAPI static ::std::string const& TAG_DISPLAY_NAME();
314
315 MCAPI static ::std::string const& TAG_ENCHANTS();
316
317 MCAPI static ::std::string const& TAG_LORE();
318
319 MCAPI static ::std::string const& TAG_REPAIR_COST();
320
321 MCAPI static ::std::string const& TAG_STORE_CAN_DESTROY();
322
323 MCAPI static ::std::string const& TAG_STORE_CAN_PLACE_ON();
324 // NOLINTEND
325
326public:
327 // constructor thunks
328 // NOLINTBEGIN
329 MCAPI void* $ctor();
330
331 MCAPI void* $ctor(::RecipeIngredient const& ingredient);
332
333 MCAPI void* $ctor(::ItemStackBase const& rhs);
334
335 MCAPI void* $ctor(::Block const& block, int count, ::CompoundTag const* _userData);
336
337 MCAPI void* $ctor(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
338 // NOLINTEND
339
340public:
341 // destructor thunk
342 // NOLINTBEGIN
343 MCAPI void $dtor();
344 // NOLINTEND
345
346public:
347 // virtual function thunks
348 // NOLINTBEGIN
349 MCFOLD void $reinit(::Item const& item, int count, int auxValue);
350
351 MCFOLD void $reinit(::Block const& block, int count);
352
353 MCFOLD void $reinit(::std::string_view const name, int count, int auxValue);
354
355 MCAPI void $setNull(::std::optional<::std::string> reason);
356
357 MCAPI ::std::string $toString() const;
358
359 MCAPI ::std::string $toDebugString() const;
360 // NOLINTEND
361
362public:
363 // vftables
364 // NOLINTBEGIN
365 MCNAPI static void** $vftable();
366 // NOLINTEND
367};
Definition Actor.h:102
Definition RedactableString.h:10
Definition BlockType.h:84
Definition Block.h:37
Definition ComponentItem.h:53
Definition CompoundTag.h:13
Definition ContainerComponent.h:28
Definition DynamicProperties.h:13
Definition HashedString.h:5
Definition ItemDescriptor.h:22
Definition ItemEnchants.h:17
Definition ItemInstance.h:15
Definition ItemStackBase.h:34
static MCAPI void ** $vftable()
Definition Item.h:66
Definition Value.h:16
Definition RecipeIngredient.h:17
Definition RenderParams.h:30
Definition SaveContext.h:5
Definition Vec3.h:10
Definition WeakPtr.h:10
Definition ItemStackBase.h:42
Definition Tick.h:5