mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Remove nullable return types on CompoundTag getters
this doesn't make sense because there are default value parameters for this
This commit is contained in:
@ -429,7 +429,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
public function getCustomName() : string{
|
||||
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
||||
if($display instanceof CompoundTag){
|
||||
return $display->getString(self::TAG_DISPLAY_NAME) ?? "";
|
||||
return $display->getString(self::TAG_DISPLAY_NAME, "");
|
||||
}
|
||||
|
||||
return "";
|
||||
@ -957,7 +957,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
}
|
||||
|
||||
$count = Binary::unsignByte($tag->getByte("Count"));
|
||||
$meta = $tag->getShort("Damage") ?? 0;
|
||||
$meta = $tag->getShort("Damage", 0);
|
||||
|
||||
$idTag = $tag->getTag("id");
|
||||
if($idTag instanceof ShortTag){
|
||||
|
Reference in New Issue
Block a user