Phpcraft
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Phpcraft\Entity\Metadata Class Reference
Inheritance diagram for Phpcraft\Entity\Metadata:
Inheritance graph
[legend]

Public Member Functions

 read (Connection $con)
 
 write (Connection $con)
 
 __toString ()
 
 getStringAttributes ()
 

Static Public Member Functions

static writeByte (Connection $con, int $index, int $value)
 
static writeFloat (Connection $con, int $index, float $value)
 
static writeOptChat (Connection $con, int $index, ?ChatComponent $value)
 
static writeString (Connection $con, int $index, string $value)
 
static writeBoolean (Connection $con, int $index, bool $value)
 
static writeInt (Connection $con, int $index, $value)
 
static finish (Connection $con)
 

Protected Member Functions

 read_ (Connection $con, int $index)
 

Detailed Description

Entity metadata. All values are "null" by default, meaning EntityMetadata::write won't write it.

Member Function Documentation

◆ __toString()

Phpcraft\Entity\Metadata::__toString ( )

◆ finish()

static Phpcraft\Entity\Metadata::finish ( Connection  $con)
static
Parameters
Connection$con
Returns
void

◆ getStringAttributes()

Phpcraft\Entity\Metadata::getStringAttributes ( )
abstract

◆ read()

Phpcraft\Entity\Metadata::read ( Connection  $con)

Reads metadata values from the Connection.

Parameters
Connection$con
Returns
Metadata $this
Exceptions
IOException

◆ read_()

Phpcraft\Entity\Metadata::read_ ( Connection  $con,
int  $index 
)
abstractprotected
Parameters
Connection$con
int$index
Returns
bool

Reimplemented in Phpcraft\Entity\Base, Phpcraft\Entity\Guardian, Phpcraft\Entity\Creeper, and Phpcraft\Entity\Living.

◆ write()

Phpcraft\Entity\Metadata::write ( Connection  $con)
abstract

Writes non-null metadata values to the Connection's write buffer.

Parameters
Connection$con
Returns
void

Reimplemented in Phpcraft\Entity\Base, Phpcraft\Entity\Guardian, Phpcraft\Entity\Creeper, and Phpcraft\Entity\Living.

◆ writeBoolean()

static Phpcraft\Entity\Metadata::writeBoolean ( Connection  $con,
int  $index,
bool  $value 
)
static
Parameters
Connection$con
int$index
bool$value
Returns
void

◆ writeByte()

static Phpcraft\Entity\Metadata::writeByte ( Connection  $con,
int  $index,
int  $value 
)
static
Parameters
Connection$con
int$index
int$value
Returns
void

◆ writeFloat()

static Phpcraft\Entity\Metadata::writeFloat ( Connection  $con,
int  $index,
float  $value 
)
static
Parameters
Connection$con
int$index
float$value
Returns
void

◆ writeInt()

static Phpcraft\Entity\Metadata::writeInt ( Connection  $con,
int  $index,
  $value 
)
static
Parameters
Connection$con
int$index
GMP | string | int$value
Returns
void

◆ writeOptChat()

static Phpcraft\Entity\Metadata::writeOptChat ( Connection  $con,
int  $index,
?ChatComponent  $value 
)
static
Parameters
Connection$con
int$index
ChatComponent | null$value
Returns
void
Exceptions
LogicException

◆ writeString()

static Phpcraft\Entity\Metadata::writeString ( Connection  $con,
int  $index,
string  $value 
)
static
Parameters
Connection$con
int$index
string$value
Returns
void