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

Public Member Functions

 __construct (float $percent=0.00, int $level=0)
 
 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $percent
 
 $level
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\SetExperiencePacket::__construct ( float  $percent = 0.00,
int  $level = 0 
)
Parameters
float$percentHow many percent the experience bar is filled from 0.00 to 1.00.
int$level

Member Function Documentation

◆ __toString()

Phpcraft\Packet\SetExperiencePacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ read()

static Phpcraft\Packet\SetExperiencePacket::read ( Connection  $con)
static

Initialises the packet class by reading its payload from the given Connection.

Parameters
Connection$con
Returns
SetExperiencePacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\SetExperiencePacket::send ( Connection  $con)

Adds the packet's ID and payload to the Connection's write buffer and sends it over the wire if the connection has a stream. Note that in some cases this will produce multiple Minecraft packets, therefore you should only use this on connections without a stream if you know what you're doing.

Parameters
Connection$con
Returns
void
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

Member Data Documentation

◆ $level

Phpcraft\Packet\SetExperiencePacket::$level
Parameters
int$level

◆ $percent

Phpcraft\Packet\SetExperiencePacket::$percent

How many percent the experience bar is filled from 0.00 to 1.00.

Parameters
float$percent