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

Public Member Functions

 __construct (int $x=0, int $z=0, bool $is_new_chunk=true, ?Chunk $chunk=null)
 
 send (Connection $con)
 
 apply (World $world)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $x
 
 $z
 
 $is_new_chunk
 
 $ignore_old_data = true
 
 $chunk
 

Detailed Description

Server-to-client.

Since
0.5.1

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\ChunkDataPacket::__construct ( int  $x = 0,
int  $z = 0,
bool  $is_new_chunk = true,
?Chunk  $chunk = null 
)

Member Function Documentation

◆ __toString()

Phpcraft\Packet\ChunkDataPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ apply()

Phpcraft\Packet\ChunkDataPacket::apply ( World  $world)
Parameters
World$world
Since
0.5.6

◆ read()

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

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

Parameters
Connection$con
Returns
static|null
Exceptions
IOException
Since
0.5.5

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\ChunkDataPacket::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

◆ $chunk

Phpcraft\Packet\ChunkDataPacket::$chunk

◆ $ignore_old_data

bool Phpcraft\Packet\ChunkDataPacket::$ignore_old_data = true
Since
0.5.23

◆ $is_new_chunk

bool Phpcraft\Packet\ChunkDataPacket::$is_new_chunk

◆ $x

int Phpcraft\Packet\ChunkDataPacket::$x

◆ $z

int Phpcraft\Packet\ChunkDataPacket::$z