mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +00:00
Fixed setValue() being useless for CompoundTags and ListTags
This commit is contained in:
parent
f6c0ba9846
commit
d4cc7d13cd
@ -49,6 +49,16 @@ class CompoundTag extends NamedTag implements \ArrayAccess{
|
|||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setValue($value){
|
||||||
|
if(is_array($value)){
|
||||||
|
foreach($value as $name => $tag){
|
||||||
|
if($tag instanceof NamedTag){
|
||||||
|
$this->{$name} = $tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function offsetExists($offset){
|
public function offsetExists($offset){
|
||||||
return isset($this->{$offset}) and $this->{$offset} instanceof Tag;
|
return isset($this->{$offset}) and $this->{$offset} instanceof Tag;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,16 @@ class ListTag extends NamedTag implements \ArrayAccess, \Countable{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setValue($value){
|
||||||
|
if(is_array($value)){
|
||||||
|
foreach($value as $name => $tag){
|
||||||
|
if($tag instanceof NamedTag){
|
||||||
|
$this->{$name} = $tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getCount(){
|
public function getCount(){
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach($this as $tag){
|
foreach($this as $tag){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user