56 ::ll::TypedStorage<1, 1, bool> mCompareAux;
57 ::ll::TypedStorage<1, 1, bool> mCompareRelevantUserData;
58 ::ll::TypedStorage<1, 1, bool> mCompareDamage;
63 LLNDAPI std::string getTypeName()
const;
64 LLNDAPI std::string getDescriptionName()
const;
65 LLNDAPI
bool isEnchanted()
const;
66 LLAPI
bool removeEnchants()
const;
67 LLAPI
void deserializeComponents(
IDataInput& input);
68 LLAPI
bool operator==(ItemStackBase
const& other)
const;
69 LLNDAPI
short getId()
const;
70 LLNDAPI
short getAuxValue()
const;
71 LLAPI
void setDamageValue(
short newDamage);
72 inline void add(
int count) { set(mCount + count); }
73 inline void remove(
int count) { set(mCount - count); }
79 ::WeakPtr<::Item> mItem;
80 ::std::unique_ptr<::CompoundTag> mUserData;
81 ::Block
const* mBlock;
84 bool mValid_DeprecatedSeeComment;
87 ::std::chrono::steady_clock::time_point mPickupTime;
88 ::std::vector<::BlockType const*> mCanPlaceOn;
89 uint64 mCanPlaceOnHash;
90 ::std::vector<::BlockType const*> mCanDestroy;
91 uint64 mCanDestroyHash;
93 ::std::unique_ptr<::ItemInstance> mChargedItem;
106 virtual ~ItemStackBase();
108 virtual void reinit(::Item
const& item,
int count,
int auxValue);
110 virtual void reinit(::Block
const& block,
int count);
112 virtual void reinit(::std::string_view
const name,
int count,
int auxValue);
114 virtual void setNull(::std::optional<::std::string> reason);
116 virtual ::std::string toString()
const;
118 virtual ::std::string toDebugString()
const;
125 MCAPI ItemStackBase();
128 MCAPI
explicit ItemStackBase(::RecipeIngredient
const& ingredient);
130 MCAPI ItemStackBase(::ItemStackBase
const& rhs);
132 MCAPI ItemStackBase(::Block
const& block,
int count = 1, ::CompoundTag
const* _userData =
nullptr);
134 MCAPI ItemStackBase(::Item
const& item,
int count = 1,
int auxValue = 0, ::CompoundTag
const* _userData =
nullptr);
137 ItemStackBase(::std::string_view name,
int count = 1,
int auxValue = 0, ::CompoundTag
const* _userData =
nullptr);
139 MCAPI
void _addCustomUserDataCommon(::std::unique_ptr<::CompoundTag>&& tag);
141 MCAPI
void _checkForItemWorldCompatibility();
143 MCAPI
void _cloneComponents(::ItemStackBase
const& other);
145 MCAPI ::std::string _getHoverFormattingPrefix()
const;
148 MCAPI
bool _hasFullOrPartialTag(::HashedString
const&
string)
const;
151 MCAPI
bool _isInstance(::std::string_view itemName)
const;
153 MCAPI
void _loadItem(::CompoundTag
const& compoundTag);
155 MCAPI
void _setChargedItem(::ItemInstance
const& item);
157 MCAPI
bool _setItem(
int id,
bool doRemap);
159 MCAPI
void _updateCompareHashes();
161 MCAPI
bool addComponents(::Json::Value
const& root, ::std::string& errorMsg);
163 MCAPI
void addCustomUserData(::ContainerComponent
const& containerComponent);
165 MCAPI
void addCustomUserData(::BlockActor& blockEntity, ::BlockSource& region);
167 MCAPI
void clearCustomLore();
169 MCAPI ::ItemEnchants constructItemEnchantsFromUserData()
const;
171 MCAPI ::SharedTypes::Legacy::ArmorSlot getArmorSlot()
const;
173 MCAPI
int getBaseRepairCost()
const;
176 MCAPI ::Block
const* getBlockForRendering()
const;
179 MCAPI ::mce::Color getColor()
const;
181 MCAPI ::std::vector<::std::string> getCustomLore()
const;
183 MCAPI ::std::string getCustomName()
const;
185 MCAPI
short getDamageValue()
const;
187 MCAPI ::std::string getDescriptionId()
const;
189 MCAPI ::ItemDescriptor getDescriptor()
const;
191 MCAPI ::std::unique_ptr<::DynamicProperties> getDynamicProperties()
const;
193 MCAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
194 getDynamicProperty(::std::string
const& key, ::std::string
const& collectionName)
const;
197 MCAPI ::Bedrock::Safety::RedactableString getFormattedHovertext(::Level& level,
bool showCategory)
const;
199 MCAPI ::std::string getHoverName()
const;
202 MCAPI
int getIdAux()
const;
205 MCAPI
int getIdAuxEnchanted()
const;
208 MCAPI uchar getMaxStackSize()
const;
210 MCAPI ::std::string getName()
const;
212 MCAPI
float getPickupPopPercentage()
const;
214 MCAPI ::std::string getRawNameId()
const;
216 MCAPI ::Bedrock::Safety::RedactableString getRedactedCustomName()
const;
218 MCAPI ::Bedrock::Safety::RedactableString getRedactedHoverName()
const;
220 MCAPI ::Bedrock::Safety::RedactableString getRedactedName()
const;
222 MCAPI
bool hasChargedItem()
const;
225 MCAPI
bool hasComponent(::std::string
const& name)
const;
228 MCAPI
bool hasSameAuxValue(::ItemStackBase
const& other)
const;
230 MCAPI
bool hasSameUserData(::ItemStackBase
const& other)
const;
232 MCAPI
bool hasTag(::ItemTag
const&
string)
const;
234 MCAPI
bool hurtAndBreak(
int deltaDamage, ::Actor* owner);
236 MCAPI
void init(::BlockType
const& block,
int count);
238 MCAPI
void init(
int id,
int count_,
int aux_,
bool doRemap);
240 MCAPI
void init(::Item
const& item,
int count,
int auxValue, ::CompoundTag
const* userData,
bool doRemap);
242 MCAPI
bool isArmorItem()
const;
245 MCAPI
bool isAttachableEquipment()
const;
248 MCAPI
bool isDamageableItem()
const;
250 MCAPI
bool isDamaged()
const;
252 MCAPI
bool isEnchantingBook()
const;
254 MCAPI
bool isFullStack()
const;
256 MCAPI
bool isHorseArmorItem()
const;
258 MCAPI
bool isHumanoidWearableItem()
const;
260 MCAPI
bool isInstance(::HashedString
const& itemName,
bool useItemLookup)
const;
262 MCAPI
bool isNull()
const;
265 MCAPI
bool isOnCooldown(::Player& player, ::SharedTypes::ItemCooldownType type)
const;
269 isOneOfBlockInstances(::std::vector<::std::reference_wrapper<::HashedString const>>
const& blockTypeIds)
const;
273 isOneOfBlockInstances(::std::initializer_list<::std::reference_wrapper<::HashedString const>> blocks)
const;
276 MCAPI
bool isOneOfInstances(
277 ::std::initializer_list<::std::reference_wrapper<::HashedString const>> items,
281 MCAPI
bool isPotionItem()
const;
283 MCAPI
bool isStackable()
const;
285 MCAPI
bool isStackable(::ItemStackBase
const& other)
const;
288 MCAPI
bool isTransparentAttachable()
const;
291 MCAPI
bool matchesEitherWearableCase(::CompoundTag
const* userData)
const;
293 MCAPI
bool matchesItem(::ItemStackBase
const& other)
const;
295 MCAPI
explicit operator bool()
const;
297 MCAPI ::ItemStackBase& operator=(::ItemStackBase
const& rhs);
299 MCAPI
void resetHoverName();
301 MCAPI
bool sameItem(::ItemStackBase
const& other, ::ItemStackBase::ComparisonOptions
const& options)
const;
303 MCAPI ::std::unique_ptr<::CompoundTag> save(::SaveContext
const& saveContext)
const;
305 MCAPI
void saveEnchantsToUserData(::ItemEnchants
const& enchant);
307 MCAPI
void serializeComponents(::IDataOutput& output)
const;
309 MCAPI
void set(
int inCount);
311 MCAPI
void setChargedItem(::ItemInstance
const& instance,
bool isSwapping);
313 MCAPI
void setCustomLore(::std::vector<::std::string>
const& lore);
315 MCAPI
void setCustomName(::Bedrock::Safety::RedactableString
const& name);
317 MCAPI
void setDynamicProperty(
318 ::std::string
const& key,
319 ::std::variant<double, float, bool, ::std::string, ::Vec3>
const& value,
320 ::std::string
const& collectionName
323 MCAPI
void setJustBrewed(
bool justBrewed);
325 MCAPI
void setPickupTime();
327 MCAPI
void setRepairCost(
int cost);
329 MCAPI
void setUnbreakable(
bool isUnbreakable);
331 MCAPI
void setUserData(::std::unique_ptr<::CompoundTag> tag);
333 MCAPI
bool shouldVanish()
const;
335 MCAPI
void startCooldown(::Player& player, ::SharedTypes::ItemCooldownType type)
const;
342 _loadBlocksForCanPlaceOnCanDestroy(::std::vector<::BlockType const*>& blockList, ::std::string
const& blockName);
345 MCAPI
static void loadItemStacksFromDescriptor(
346 ::std::vector<::ItemStack>& outItems,
347 ::std::vector<::NetworkItemStackDescriptor>
const& descriptors,
348 ::BlockPalette& blockPalette,
357 MCAPI static ::ItemStackBase::ComparisonOptions
const& COMPARISONOPTIONS_AUXANDRELEVANTUSERDATA();
359 MCAPI static ::ItemStackBase::ComparisonOptions
const& COMPARISONOPTIONS_RELEVANTUSERDATA();
361 MCAPI static ::std::string
const& TAG_CAN_DESTROY();
363 MCAPI static ::std::string
const& TAG_CAN_PLACE_ON();
365 MCAPI static ::std::string
const& TAG_CHARGED_ITEM();
367 MCAPI static ::std::string
const& TAG_DISPLAY();
369 MCAPI static ::std::string
const& TAG_DISPLAY_FILTERED_NAME();
371 MCAPI static ::std::string
const& TAG_DISPLAY_NAME();
373 MCAPI static ::std::string
const& TAG_ENCHANTS();
375 MCAPI static ::std::string
const& TAG_LORE();
377 MCAPI static ::std::string
const& TAG_REPAIR_COST();
379 MCAPI static ::std::string
const& TAG_STORE_CAN_DESTROY();
381 MCAPI static ::std::string
const& TAG_STORE_CAN_PLACE_ON();
383 MCAPI static ::std::string
const& TAG_UNBREAKABLE();
393 MCAPI
void* $ctor(::RecipeIngredient
const& ingredient);
395 MCAPI
void* $ctor(::ItemStackBase
const& rhs);
397 MCAPI
void* $ctor(::Block
const& block,
int count, ::CompoundTag
const* _userData);
399 MCAPI
void* $ctor(::Item
const& item,
int count,
int auxValue, ::CompoundTag
const* _userData);
401 MCAPI
void* $ctor(::std::string_view name,
int count,
int auxValue, ::CompoundTag
const* _userData);
413 MCFOLD
void $reinit(::Item
const& item,
int count,
int auxValue);
415 MCFOLD
void $reinit(::Block
const& block,
int count);
417 MCFOLD
void $reinit(::std::string_view
const name,
int count,
int auxValue);
419 MCAPI
void $setNull(::std::optional<::std::string> reason);
421 MCAPI ::std::string $toString()
const;
423 MCAPI ::std::string $toDebugString()
const;
431 MCAPI
static void** $vftable();