GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
IntArrayTag Class Reference

Public Member Functions

 getType ()
 
 read (NBT $nbt, bool $network=false)
 
 write (NBT $nbt, bool $network=false)
 
 __toString ()
 
- Public Member Functions inherited from NamedTag
 __construct ($name="", $value=null)
 
 getName ()
 
 setName ($name)
 
- Public Member Functions inherited from Tag
getValue ()
 
 getType ()
 
 setValue ($value)
 
 write (NBT $nbt, bool $network=false)
 
 read (NBT $nbt, bool $network=false)
 
 __toString ()
 

Additional Inherited Members

- Protected Attributes inherited from NamedTag
 $__name
 
- Protected Attributes inherited from Tag
 $value
 

Member Function Documentation

◆ __toString()

__toString ( )
Returns
string
62  {
63  $str = get_class($this) . "{\n";
64  $str .= implode(", ", $this->value);
65  return $str . "}";
66  }

◆ getType()

getType ( )
Returns
int
33  {
34  return NBT::TAG_IntArray;
35  }

◆ read()

read ( NBT  $nbt,
bool  $network = false 
)
Parameters
NBT$nbt
bool$network
Returns
mixed|void
43  {
44  $size = $nbt->getInt($network);
45  $this->value = array_values(unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4)));
46  }

◆ write()

write ( NBT  $nbt,
bool  $network = false 
)
Parameters
NBT$nbt
bool$network
Returns
mixed|void
54  {
55  $nbt->putInt(count($this->value), $network);
56  $nbt->put(pack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", ...$this->value));
57  }

The documentation for this class was generated from the following file: