mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Make Item->getNamedTag() a bit less ugly
This commit is contained in:
parent
81dee2f9fc
commit
00bf190e54
@ -595,10 +595,9 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
public function getNamedTag(){
|
||||
if(!$this->hasCompoundTag()){
|
||||
return null;
|
||||
}elseif($this->cachedNBT !== null){
|
||||
return $this->cachedNBT;
|
||||
}
|
||||
return $this->cachedNBT = self::parseCompoundTag($this->tags);
|
||||
|
||||
return $this->cachedNBT ?? ($this->cachedNBT = $this->cachedNBT = self::parseCompoundTag($this->tags));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user