Fixed incorrect unknown item filtering logic

this caused recipes with wildcard inputs to not show up at all.
This commit is contained in:
Dylan K. Taylor 2022-06-06 18:50:40 +01:00
parent 08fbf92d8d
commit 93124c79ea
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -41,11 +41,12 @@ final class CraftingManagerFromDataHelper{
private static function containsUnknownItems(array $items) : bool{
$factory = ItemFactory::getInstance();
foreach($items as $item){
if(
if($item instanceof Durable || $item->hasAnyDamageValue()){
//TODO: this check is imperfect and might cause problems if meta 0 isn't used for some reason
(($item instanceof Durable || $item->hasAnyDamageValue()) && !$factory->isRegistered($item->getId())) ||
!$factory->isRegistered($item->getId(), $item->getMeta())
){
if(!$factory->isRegistered($item->getId())){
return true;
}
}elseif(!$factory->isRegistered($item->getId(), $item->getMeta())){
return true;
}
}