mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-10 15:59:39 +00:00
bad fix for WritableBook phpstan warning
master has this shit so much better
This commit is contained in:
parent
39c607cbd5
commit
8ecf5e02b9
@ -186,16 +186,18 @@ class WritableBook extends Item{
|
||||
* @return CompoundTag[]
|
||||
*/
|
||||
public function getPages() : array{
|
||||
$pages = $this->getNamedTag()->getListTag(self::TAG_PAGES);
|
||||
if($pages === null){
|
||||
return [];
|
||||
}
|
||||
/** @var CompoundTag[] $pages */
|
||||
$pages = $this->getPagesTag()->getValue();
|
||||
|
||||
return $pages->getValue();
|
||||
return $pages;
|
||||
}
|
||||
|
||||
protected function getPagesTag() : ListTag{
|
||||
return $this->getNamedTag()->getListTag(self::TAG_PAGES) ?? new ListTag(self::TAG_PAGES, [], NBT::TAG_Compound);
|
||||
$pagesTag = $this->getNamedTag()->getListTag(self::TAG_PAGES);
|
||||
if($pagesTag !== null and $pagesTag->getTagType() === NBT::TAG_Compound){
|
||||
return $pagesTag;
|
||||
}
|
||||
return new ListTag(self::TAG_PAGES, [], NBT::TAG_Compound);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user