mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +00:00
Fix "Creating default object from empty value" (#858)
while setting lore to items.
This commit is contained in:
parent
86de0bddd9
commit
547a09c8d4
@ -685,7 +685,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setLore(array $lines){
|
public function setLore(array $lines){
|
||||||
$tag = $this->getNamedTag();
|
$tag = $this->getNamedTag() ?? new CompoundTag("", []);
|
||||||
if(!isset($tag->display)){
|
if(!isset($tag->display)){
|
||||||
$tag->display = new CompoundTag("display", []);
|
$tag->display = new CompoundTag("display", []);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user