mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +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:
@ -1764,7 +1764,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($tag instanceof ListTag){
|
||||
foreach($tag as $v){
|
||||
if($v instanceof StringTag){
|
||||
$entry = ItemFactory::fromString($v->getValue());
|
||||
$entry = ItemFactory::fromStringSingle($v->getValue());
|
||||
if($entry->getId() > 0 and $entry->getBlock()->getId() === $target->getId()){
|
||||
$canBreak = true;
|
||||
break;
|
||||
@ -1919,7 +1919,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($tag instanceof ListTag){
|
||||
foreach($tag as $v){
|
||||
if($v instanceof StringTag){
|
||||
$entry = ItemFactory::fromString($v->getValue());
|
||||
$entry = ItemFactory::fromStringSingle($v->getValue());
|
||||
if($entry->getId() > 0 and $entry->getBlock()->getId() === $blockClicked->getId()){
|
||||
$canPlace = true;
|
||||
break;
|
||||
|
@ -120,7 +120,7 @@ class Flat extends Generator{
|
||||
|
||||
$cnt = $matches[1] !== "" ? (int) $matches[1] : 1;
|
||||
try{
|
||||
$b = ItemFactory::fromString($matches[2])->getBlock();
|
||||
$b = ItemFactory::fromStringSingle($matches[2])->getBlock();
|
||||
}catch(\InvalidArgumentException $e){
|
||||
throw new InvalidGeneratorOptionsException("Invalid preset layer \"$line\": " . $e->getMessage(), 0, $e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user