Phpcraft
Public Member Functions | Public Attributes | List of all members
Phpcraft\World\World Class Reference

Public Member Functions

 set (Point3D $pos, ?BlockState $blockState=null)
 
 getChunk (int $x, int $z)
 
 apply (Structure $structure, Point3D $origin)
 

Public Attributes

 $chunkGenerator
 
 $chunks = []
 
 $changed_chunks = []
 

Detailed Description

Since
0.5

Member Function Documentation

◆ apply()

Phpcraft\World\World::apply ( Structure  $structure,
Point3D  $origin 
)
Parameters
Structure$structure
Point3D$origin
Returns
void

◆ getChunk()

Phpcraft\World\World::getChunk ( int  $x,
int  $z 
)

Gets a chunk, generating it if needed.

Parameters
int$x
int$z
Returns
Chunk

◆ set()

Phpcraft\World\World::set ( Point3D  $pos,
?BlockState  $blockState = null 
)

Sets the block state at the given position.

Parameters
Point3D$pos
BlockState | null$blockState

Member Data Documentation

◆ $changed_chunks

Phpcraft\World\World::$changed_chunks = []

◆ $chunkGenerator

ChunkGenerator Phpcraft\World\World::$chunkGenerator

◆ $chunks

Phpcraft\World\World::$chunks = []