mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 18:11:52 +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);
|
parent::__construct($name, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public function getCount(){
|
public function getCount(){
|
||||||
$count = 0;
|
return count($this->getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return NamedTag[]
|
||||||
|
*/
|
||||||
|
public function &getValue(){
|
||||||
|
$result = [];
|
||||||
foreach($this as $tag){
|
foreach($this as $tag){
|
||||||
if($tag instanceof Tag){
|
if($tag instanceof NamedTag){
|
||||||
++$count;
|
$result[$tag->getName()] = $tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $count;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user