Made Item::setLore() fluent (#1120)

This commit is contained in:
jasonwynn10 2017-06-23 03:39:56 -04:00 committed by Dylan K. Taylor
parent 8bf1cc9e48
commit b83c135c3f

View File

@ -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;
} }
/** /**