public function write(NBT $nbt) { foreach ($this as $tag) { if ($tag instanceof Tag and !$tag instanceof End) { $nbt->writeTag($tag); } } $nbt->writeTag(new End()); }
public function write(NBT $nbt, bool $network = false) { foreach ($this as $tag) { if ($tag instanceof Tag and !$tag instanceof EndTag) { $nbt->writeTag($tag, $network); } } $nbt->writeTag(new EndTag(), $network); }