mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
* implement a bit * change shift to ctrl * add enhancement #2 * add ctrl-interaction with content access * fix libinventory.move bug (none checking) * fix p.5 * move shareinv logic into inventory_utils * add inventory utils * small refactor * fix iframe.src = "" --------- Co-authored-by: MihailRis <mexaruc@gmail.com>
This commit is contained in:
parent
f8e4e2759b
commit
3b3bf8e878
9 changed files with 84 additions and 37 deletions
|
|
@ -48,6 +48,14 @@ void ItemStack::setCount(itemcount_t count) {
|
|||
}
|
||||
}
|
||||
|
||||
void ItemStack::maximizeCount(const ContentIndices& indices) {
|
||||
auto& def = indices.items.require(getItemId());
|
||||
this->count = def.stackSize;
|
||||
if (count == 0) {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
void ItemStack::setField(std::string_view name, dv::value value) {
|
||||
if (fields == nullptr) {
|
||||
if (value == nullptr) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public:
|
|||
void set(const ItemStack& item);
|
||||
void set(ItemStack&& item);
|
||||
void setCount(itemcount_t count);
|
||||
void maximizeCount(const ContentIndices& indices);
|
||||
|
||||
/// @brief Set a field in the item stack data.
|
||||
void setField(std::string_view name, dv::value value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue