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