◆ __construct()
__construct |
( |
|
$name = "" , |
|
|
|
$value = [] |
|
) |
| |
- Parameters
-
string | $name | |
| NamedTag[] | $value |
35 $this->__name = $name;
37 $this->{$tag->getName()} = $tag;
◆ __toString()
- Returns
- string
143 $str = get_class($this) .
"{\n";
144 foreach($this as $tag){
145 if($tag instanceof Tag){
146 $str .= get_class($tag) .
":" . $tag->__toString() .
"\n";
◆ getCount()
- Returns
- int
46 foreach($this as $tag){
47 if($tag instanceof Tag){
◆ getType()
◆ offsetExists()
- Parameters
-
- Returns
- bool
61 return isset($this->{$offset}) and $this->{$offset} instanceof Tag;
◆ offsetGet()
- Parameters
-
- Returns
- null
70 if(isset($this->{$offset}) and $this->{$offset} instanceof Tag){
71 if($this->{$offset} instanceof \ArrayAccess){
72 return $this->{$offset};
74 return $this->{$offset}->getValue();
◆ offsetSet()
offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
- Parameters
-
88 }elseif(isset($this->{$offset}) and $this->{$offset} instanceof Tag){
89 $this->{$offset}->setValue(
$value);
◆ offsetUnset()
- Parameters
-
97 unset($this->{$offset});
◆ read()
read |
( |
NBT |
$nbt, |
|
|
bool |
$network = false |
|
) |
| |
- Parameters
-
- Returns
- mixed|void
116 $tag = $nbt->readTag($network);
117 if($tag instanceof NamedTag and $tag->getName() !==
""){
118 $this->{$tag->getName()} = $tag;
120 }
while(!($tag instanceof EndTag) and !$nbt->feof());
◆ write()
write |
( |
NBT |
$nbt, |
|
|
bool |
$network = false |
|
) |
| |
- Parameters
-
- Returns
- mixed|void
130 foreach($this as $tag){
131 if($tag instanceof Tag and !($tag instanceof EndTag)){
132 $nbt->writeTag($tag, $network);
136 $nbt->writeTag(
new EndTag, $network);
The documentation for this class was generated from the following file:
- src/pocketmine/nbt/tag/CompoundTag.php