mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed missing getValue() implementation on CompoundTag
This commit is contained in:
parent
a39c9e8c8e
commit
0ee452773d
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user