mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Fixed incorrect unknown item filtering logic
this caused recipes with wildcard inputs to not show up at all.
This commit is contained in:
parent
08fbf92d8d
commit
93124c79ea
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user