mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 10:01:53 +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 [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $lines
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
public function setLore(array $lines){
|
public function setLore(array $lines){
|
||||||
$tag = $this->getNamedTag() ?? new CompoundTag("", []);
|
$tag = $this->getNamedTag() ?? new CompoundTag("", []);
|
||||||
if(!isset($tag->display)){
|
if(!isset($tag->display)){
|
||||||
@ -700,6 +705,8 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->setNamedTag($tag);
|
$this->setNamedTag($tag);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user