mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
migrate to new CompoundTag API (#1515)
This commit is contained in:
@ -481,9 +481,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
public function getLore() : array{
|
||||
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
||||
if($display instanceof CompoundTag and ($lore = $display->getListTag(self::TAG_DISPLAY_LORE)) !== null){
|
||||
return array_map(function(StringTag $tag) : string{
|
||||
return $tag->getValue();
|
||||
}, $lore->getValue());
|
||||
return $lore->getAllValues();
|
||||
}
|
||||
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user