mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
ItemFactory: extract fromStringSingle() from fromString()
on PM4, the multiple functionality is removed, but on PM3 this is a problem for phpstan.
This commit is contained in:
@ -852,7 +852,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
$item = ItemFactory::get($idTag->getValue(), $meta, $count);
|
||||
}elseif($idTag instanceof StringTag){ //PC item save format
|
||||
try{
|
||||
$item = ItemFactory::fromString($idTag->getValue());
|
||||
$item = ItemFactory::fromStringSingle($idTag->getValue());
|
||||
}catch(\InvalidArgumentException $e){
|
||||
//TODO: improve error handling
|
||||
return ItemFactory::get(Item::AIR, 0, 0);
|
||||
|
Reference in New Issue
Block a user