Skip to content

Commit

Permalink
chore: add itemstack ctor default param
Browse files Browse the repository at this point in the history
  • Loading branch information
Dofes committed Jan 11, 2025
1 parent 01e5aaf commit b1ce9bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions src/mc/world/item/ItemInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ class ItemInstance : public ::ItemStackBase {

MCAPI ItemInstance(::ItemInstance const& rhs);

MCAPI ItemInstance(::BlockLegacy const& block, int count);
MCAPI ItemInstance(::BlockLegacy const& block, int count = 1);

MCAPI ItemInstance(::Block const& block, int count, ::CompoundTag const* _userData);
MCAPI ItemInstance(::Block const& block, int count = 1, ::CompoundTag const* _userData = nullptr);

MCAPI ItemInstance(::Item const& item, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI ItemInstance(::Item const& item, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI ItemInstance(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI
ItemInstance(::std::string_view name, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI ::ItemInstance clone() const;

Expand Down
8 changes: 4 additions & 4 deletions src/mc/world/item/ItemStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class ItemStack : public ::ItemStackBase {

MCAPI explicit ItemStack(::ItemInstance const& rhs);

MCAPI ItemStack(::BlockLegacy const& block, int count);
MCAPI ItemStack(::BlockLegacy const& block, int count = 1);

MCAPI ItemStack(::Block const& block, int count, ::CompoundTag const* _userData);
MCAPI ItemStack(::Block const& block, int count = 1, ::CompoundTag const* _userData = nullptr);

MCAPI ItemStack(::Item const& item, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI ItemStack(::Item const& item, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI ItemStack(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI ItemStack(::std::string_view name, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI void _assignNetIdVariant(::ItemStack const& fromItem) const;

Expand Down
7 changes: 4 additions & 3 deletions src/mc/world/item/ItemStackBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ class ItemStackBase {

MCAPI ItemStackBase(::BlockLegacy const& block, int count);

MCAPI ItemStackBase(::Block const& block, int count, ::CompoundTag const* _userData);
MCAPI ItemStackBase(::Block const& block, int count = 1, ::CompoundTag const* _userData = nullptr);

MCAPI ItemStackBase(::Item const& item, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI ItemStackBase(::Item const& item, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI ItemStackBase(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
MCAPI
ItemStackBase(::std::string_view name, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);

MCAPI void _addCustomUserDataCommon(::std::unique_ptr<::CompoundTag>&& tag);

Expand Down

0 comments on commit b1ce9bd

Please sign in to comment.