mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Automatic item and node colorization (#5640)
* Automatic item and node colorization Now nodes with a palette yield colored item stacks, and colored items place colored nodes by default. The client predicts the colorization. * Backwards compatibility * Use nil * Style fixes * Fix code style * Document changes
This commit is contained in:
@@ -658,7 +658,7 @@ bool InventoryList::roomForItem(const ItemStack &item_) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InventoryList::containsItem(const ItemStack &item) const
|
||||
bool InventoryList::containsItem(const ItemStack &item, bool match_meta) const
|
||||
{
|
||||
u32 count = item.count;
|
||||
if(count == 0)
|
||||
@@ -669,9 +669,9 @@ bool InventoryList::containsItem(const ItemStack &item) const
|
||||
{
|
||||
if(count == 0)
|
||||
break;
|
||||
if(i->name == item.name)
|
||||
{
|
||||
if(i->count >= count)
|
||||
if (i->name == item.name
|
||||
&& (!match_meta || (i->metadata == item.metadata))) {
|
||||
if (i->count >= count)
|
||||
return true;
|
||||
else
|
||||
count -= i->count;
|
||||
|
Reference in New Issue
Block a user