Added API method Item::canStackWith()

This commit is contained in:
Dylan K. Taylor
2021-06-29 19:52:52 +01:00
parent 32d7b1e6af
commit 7ba573db77
6 changed files with 13 additions and 5 deletions

View File

@ -82,7 +82,7 @@ class CraftingManager{
foreach($items as $i => $item){
foreach($result as $otherItem){
if($item->equals($otherItem)){
if($item->canStackWith($otherItem)){
$otherItem->setCount($otherItem->getCount() + $item->getCount());
continue 2;
}