Phpcraft
Public Member Functions | Public Attributes | List of all members
Phpcraft\NBT\ByteTag Class Reference
Inheritance diagram for Phpcraft\NBT\ByteTag:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\NBT\ByteTag:
Collaboration graph
[legend]

Public Member Functions

 __construct (string $name, int $value=0)
 
 write (Connection $con, bool $inList=false)
 
 copy ()
 
 __toString ()
 
 toSNBT (bool $fancy=false, bool $inList=false)
 

Public Attributes

const ORD = 1
 
 $value
 
- Public Attributes inherited from Phpcraft\NBT\NBT
const ORD = null
 
 $name
 

Additional Inherited Members

- Static Public Member Functions inherited from Phpcraft\NBT\NBT
static fromString (string $nbt)
 
static fromSNBT (string $snbt, bool $inList=false)
 
static stringFromSNBT (string $snbt)
 
static isValidBareString (string $string)
 
static stringToSNBT (string $string)
 
- Protected Member Functions inherited from Phpcraft\NBT\NBT
 _write (Connection $con)
 
- Static Protected Member Functions inherited from Phpcraft\NBT\NBT
static parseSNBTArray (string $snbt, bool $list)
 
static indentString (string $string)
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\NBT\ByteTag::__construct ( string  $name,
int  $value = 0 
)
Parameters
string$nameThe name of this tag.
int$valueThe value of this tag.

Member Function Documentation

◆ __toString()

Phpcraft\NBT\ByteTag::__toString ( )

Reimplemented from Phpcraft\NBT\NBT.

◆ copy()

Phpcraft\NBT\ByteTag::copy ( )
Returns
ByteTag

Reimplemented from Phpcraft\NBT\NBT.

◆ toSNBT()

Phpcraft\NBT\ByteTag::toSNBT ( bool  $fancy = false,
bool  $inList = false 
)

Returns the NBT tag in SNBT (stringified NBT) format, as used in commands.

Parameters
bool$fancy
boolean$inListIgnore this parameter.
Returns
string

Reimplemented from Phpcraft\NBT\NBT.

◆ write()

Phpcraft\NBT\ByteTag::write ( Connection  $con,
bool  $inList = false 
)

Adds the NBT tag to the write buffer of the connection.

Parameters
Connection$con
boolean$inListIgnore this parameter.
Returns
Connection $con

Reimplemented from Phpcraft\NBT\NBT.

Member Data Documentation

◆ $value

int Phpcraft\NBT\ByteTag::$value

The value of this tag.

◆ ORD

const Phpcraft\NBT\ByteTag::ORD = 1