mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 16:45:13 +00:00
Fixed missing getValue() implementation on CompoundTag
This commit is contained in:
@ -39,15 +39,25 @@ class CompoundTag extends NamedTag implements \ArrayAccess{
|
||||
parent::__construct($name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getCount(){
|
||||
$count = 0;
|
||||
return count($this->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NamedTag[]
|
||||
*/
|
||||
public function &getValue(){
|
||||
$result = [];
|
||||
foreach($this as $tag){
|
||||
if($tag instanceof Tag){
|
||||
++$count;
|
||||
if($tag instanceof NamedTag){
|
||||
$result[$tag->getName()] = $tag;
|
||||
}
|
||||
}
|
||||
|
||||
return $count;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user