mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Made Item::setLore() fluent (#1120)
This commit is contained in:
parent
8bf1cc9e48
commit
b83c135c3f
@ -687,6 +687,11 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $lines
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLore(array $lines){
|
||||
$tag = $this->getNamedTag() ?? new CompoundTag("", []);
|
||||
if(!isset($tag->display)){
|
||||
@ -700,6 +705,8 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
}
|
||||
|
||||
$this->setNamedTag($tag);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user