PHP Class pocketmine\level\Level

Inheritance: implements pocketmine\level\ChunkManager, implements pocketmine\metadata\Metadatable
Mostra file Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$COMPRESSION_LEVEL
$sleepTicks
$stopTime
$tickRateCounter
$tickRateTime
$timings pocketmine\event\LevelTimings
$updateEntities pocketmine\entity\Entity[]
$updateTiles pocketmine\tile\Tile[]

Public Methods

Method Description
__construct ( Server $server, string $name, string $path, string $provider ) Init the default level data
__debugInfo ( ) : array
addChunkPacket ( integer $chunkX, integer $chunkZ, DataPacket $packet )
addEntity ( Entity $entity )
addEntityMotion ( integer $chunkX, integer $chunkZ, integer $entityId, float $x, float $y, float $z )
addEntityMovement ( integer $chunkX, integer $chunkZ, integer $entityId, float $x, float $y, float $z, float $yaw, float $pitch, $headYaw = null )
addParticle ( Particle $particle, array $players = null )
addPlayerMovement ( $chunkX, $chunkZ, $entityId, $x, $y, $z, $yaw, $pitch, $onGround, $headYaw = null )
addSound ( Sound $sound, array $players = null )
addTile ( Tile $tile )
blockHash ( integer $x, integer $y, integer $z )
canBlockSeeSky ( Vector3 $pos ) : boolean
cancelUnloadChunkRequest ( integer $x, integer $z )
checkSleep ( )
checkTime ( ) WARNING: Do not use this, it's only for internal use.
chunkBlockHash ( integer $x, integer $y, integer $z ) : integer
chunkHash ( integer $x, integer $z ) : string Returns the chunk unique hash/key
chunkRequestCallback ( $x, $z, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS )
clearCache ( boolean $full = false )
clearChunkCache ( integer $chunkX, integer $chunkZ )
close ( )
doChunkGarbageCollection ( )
doTick ( integer $currentTick ) : boolean WARNING: Do not use this, it's only for internal use.
dropItem ( Vector3 $source, Item $item, Vector3 $motion = null, integer $delay = 10 ) : null | Item
generateChunk ( integer $x, integer $z, boolean $force = false )
generateChunkCallback ( integer $x, integer $z, pocketmine\level\format\FullChunk $chunk )
generateChunkLoaderId ( pocketmine\level\ChunkLoader $loader ) : integer
getAutoSave ( ) : boolean
getBiomeColor ( integer $x, integer $z ) : array
getBiomeId ( integer $x, integer $z ) : integer
getBlock ( Vector3 $pos, boolean $cached = true ) : Block Gets the Block object on the Vector3 location
getBlockDataAt ( integer $x, integer $y, integer $z ) : integer Gets the raw block metadata
getBlockExtraDataAt ( integer $x, integer $y, integer $z ) : integer Gets the raw block extra data
getBlockIdAt ( integer $x, integer $y, integer $z ) : integer Gets the raw block id.
getBlockLightAt ( integer $x, integer $y, integer $z ) : integer Gets the raw block light level
getBlockMetadata ( ) : BlockMetadataStore
getBlockSkyLightAt ( integer $x, integer $y, integer $z ) : integer Gets the raw block skylight level
getBlockTempData ( Vector3 $pos ) : integer This method is internal use only. Do not use this in plugins
getBlockXYZ ( $hash, &$x, &$y, &$z )
getChunk ( integer $x, integer $z, boolean $create = false ) : pocketmine\level\format\FullChunk | pocketmine\level\format\Chunk Gets the Chunk object
getChunkEntities ( integer $X, integer $Z ) : array Returns a list of the entities on a given chunk
getChunkLoaders ( integer $chunkX, integer $chunkZ ) : array Gets the chunk loaders being used in a specific chunk
getChunkPlayers ( integer $chunkX, integer $chunkZ ) : array Gets the players being used in a specific chunk
getChunkTiles ( integer $X, integer $Z ) : array Gives a list of the Tile entities on a given chunk
getChunks ( ) : array
getCollidingEntities ( AxisAlignedBB $bb, Entity $entity = null ) : array Returns the entities colliding the current one inside the AxisAlignedBB
getCollisionBlocks ( AxisAlignedBB $bb, boolean $targetFirst = false ) : array
getCollisionCubes ( Entity $entity, AxisAlignedBB $bb, boolean $entities = true ) : array
getDimension ( ) : integer
getEntities ( ) : array Gets the list of all the entities in this level
getEntity ( integer $entityId ) : Entity
getFolderName ( ) : string Returns the Level folder name
getFullBlock ( integer $x, integer $y, integer $z ) : integer
getFullLight ( Vector3 $pos ) : integer * public function rayTraceBlocks(Vector3 $pos1, Vector3 $pos2, $flag = false, $flag1 = false, $flag2 = false){ if(!is_nan($pos1->x) and !is_nan($pos1->y) and !is_nan($pos1->z)){ if(!is_nan($pos2->x) and !is_nan($pos2->y) and !is_nan($pos2->z)){ $x1 = (int) $pos1->x; $y1 = (int) $pos1->y; $z1 = (int) $pos1->z; $x2 = (int) $pos2->x; $y2 = (int) $pos2->y; $z2 = (int) $pos2->z;
getHeightMap ( integer $x, integer $z ) : integer
getHighestBlockAt ( integer $x, integer $z ) : integer Gets the highest block Y value at a specific $x and $z
getId ( ) : integer Returns the unique level identifier
getLoaders ( ) : array
getMetadata ( $metadataKey )
getName ( ) : string Returns the Level name
getNearbyEntities ( AxisAlignedBB $bb, Entity $entity = null ) : array Returns the entities near the current one inside the AxisAlignedBB
getNearbyExperienceOrb ( AxisAlignedBB $bb ) : array
getPlayers ( ) : array Returns a list of the players in this level
getProvider ( ) : pocketmine\level\format\LevelProvider
getSafeSpawn ( Vector3 $spawn = null ) : boolean | Position
getSeed ( ) : integer | string Gets the level seed
getServer ( ) : Server
getSpawnLocation ( ) : Position Returns a Position pointing to the spawn
getTickRate ( ) : integer
getTickRateTime ( )
getTile ( Vector3 $pos ) : Tile Returns the Tile in a position, or null if not found
getTileById ( integer $tileId ) : Tile
getTiles ( ) : array Returns a list of the Tile entities in this level
getTime ( ) : integer Gets the current time
getWaterHeight ( ) : integer
getWeather ( ) : Weather
getXZ ( $hash, &$x, &$z )
hasMetadata ( $metadataKey )
initLevel ( )
isChunkGenerated ( integer $x, integer $z ) : boolean
isChunkInUse ( integer $x, integer $z ) : boolean
isChunkLoaded ( integer $x, integer $z ) : boolean
isChunkPopulated ( integer $x, integer $z ) : boolean
isFullBlock ( Vector3 $pos ) : boolean
isSpawnChunk ( integer $X, integer $Z ) : boolean Returns true if the spawn is part of the spawn
loadChunk ( integer $x, integer $z, boolean $generate = true ) : boolean
populateChunk ( integer $x, integer $z, boolean $force = false ) : boolean
regenerateChunk ( integer $x, integer $z )
registerChunkLoader ( pocketmine\level\ChunkLoader $loader, integer $chunkX, integer $chunkZ, boolean $autoLoad = true )
registerGenerator ( )
removeEntity ( Entity $entity ) Removes the entity from the level index
removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
removeTile ( Tile $tile )
requestChunk ( integer $x, integer $z, Player $player )
save ( boolean $force = false ) : boolean
saveChunks ( )
scheduleUpdate ( Vector3 $pos, integer $delay )
sendBlockExtraData ( integer $x, integer $y, integer $z, integer $id, integer $data, array $targets = null )
sendBlocks ( array $target, array $blocks, integer $flags = UpdateBlockPacket::FLAG_NONE, boolean $optimizeRebuilds = false )
sendLighting ( integer $x, integer $y, integer $z, Player $p ) Directly send a lightning to a player
sendTime ( ) WARNING: Do not use this, it's only for internal use.
setAutoSave ( boolean $value )
setBiomeColor ( integer $x, integer $z, integer $R, integer $G, integer $B )
setBiomeId ( integer $x, integer $z, integer $biomeId )
setBlock ( Vector3 $pos, Block $block, boolean $direct = false, boolean $update = true ) : boolean Sets on Vector3 the data from a Block object, does block updates and puts the changes to the send queue.
setBlockDataAt ( integer $x, integer $y, integer $z, integer $data ) Sets the raw block metadata.
setBlockExtraDataAt ( integer $x, integer $y, integer $z, integer $id, integer $data ) Sets the raw block metadata.
setBlockIdAt ( integer $x, integer $y, integer $z, integer $id ) Sets the raw block id.
setBlockLightAt ( integer $x, integer $y, integer $z, integer $level ) Sets the raw block light level.
setBlockSkyLightAt ( integer $x, integer $y, integer $z, integer $level ) Sets the raw block skylight level.
setBlockTempData ( Vector3 $pos, $data = null ) This method is internal use only. Do not use this in plugins
setChunk ( integer $chunkX, integer $chunkZ, pocketmine\level\format\FullChunk $chunk = null, boolean $unload = true )
setDimension ( integer $dimension )
setHeightMap ( integer $x, integer $z, integer $value )
setMetadata ( $metadataKey, MetadataValue $metadataValue )
setSeed ( integer $seed ) Sets the seed for the level
setSpawnLocation ( Vector3 $pos ) Sets the level spawn location
setTickRate ( integer $tickRate )
setTime ( integer $time ) Sets the current time on the level
spawnLightning ( Vector3 $pos ) : Lightning Add a lightning
spawnXPOrb ( Vector3 $pos, integer $exp = 1 ) : boolean | XPOrb Add an experience orb
startTime ( ) Start the time again, if it was stopped
stopTime ( ) Stops the time for the level, will not save the lock state to disk
unload ( boolean $force = false ) : boolean Unloads the current level from memory safely
unloadChunk ( integer $x, integer $z, boolean $safe = true, boolean $trySave = true ) : boolean
unloadChunkRequest ( integer $x, integer $z, boolean $safe = true ) : boolean
unloadChunks ( boolean $force = false )
unregisterChunkLoader ( pocketmine\level\ChunkLoader $loader, integer $chunkX, integer $chunkZ )
unregisterGenerator ( )
updateAllLight ( Vector3 $pos )
updateAround ( Vector3 $pos )
updateBlockLight ( integer $x, integer $y, integer $z )
updateBlockSkyLight ( integer $x, integer $y, integer $z )
useBreakOn ( Vector3 $vector, Item &$item = null, Player $player = null, boolean $createParticles = false ) : boolean Tries to break a block using a item, including Player time checks if available It'll try to lower the durability if Item is a tool, and set it to Air if broken.
useItemOn ( Vector3 $vector, Item &$item, integer $face, float $fx, float $fy, float $fz, Player $player = null ) : boolean Uses a item on a position and face, placing it or activating the block

Private Methods

Method Description
computeRemoveBlockLight ( integer $x, integer $y, integer $z, integer $currentLight, SplQueue $queue, SplQueue $spreadQueue, array &$visited, array &$spreadVisited )
computeSpreadBlockLight ( integer $x, integer $y, integer $z, integer $currentLight, SplQueue $queue, array &$visited )
processChunkRequest ( )
queueUnloadChunk ( integer $x, integer $z )
sendChunkFromCache ( $x, $z )
tickChunks ( )

Method Details

__construct() public method

Init the default level data
public __construct ( Server $server, string $name, string $path, string $provider )
$server pocketmine\Server
$name string
$path string
$provider string Class that extends LevelProvider

__debugInfo() public method

public __debugInfo ( ) : array
return array

addChunkPacket() public method

public addChunkPacket ( integer $chunkX, integer $chunkZ, DataPacket $packet )
$chunkX integer
$chunkZ integer
$packet pocketmine\network\protocol\DataPacket

addEntity() public method

public addEntity ( Entity $entity )
$entity pocketmine\entity\Entity

addEntityMotion() public method

public addEntityMotion ( integer $chunkX, integer $chunkZ, integer $entityId, float $x, float $y, float $z )
$chunkX integer
$chunkZ integer
$entityId integer
$x float
$y float
$z float

addEntityMovement() public method

public addEntityMovement ( integer $chunkX, integer $chunkZ, integer $entityId, float $x, float $y, float $z, float $yaw, float $pitch, $headYaw = null )
$chunkX integer
$chunkZ integer
$entityId integer
$x float
$y float
$z float
$yaw float
$pitch float

addParticle() public method

public addParticle ( Particle $particle, array $players = null )
$particle pocketmine\level\particle\Particle
$players array

addPlayerMovement() public method

public addPlayerMovement ( $chunkX, $chunkZ, $entityId, $x, $y, $z, $yaw, $pitch, $onGround, $headYaw = null )

addSound() public method

public addSound ( Sound $sound, array $players = null )
$sound pocketmine\level\sound\Sound
$players array

addTile() public method

public addTile ( Tile $tile )
$tile pocketmine\tile\Tile

blockHash() public static method

public static blockHash ( integer $x, integer $y, integer $z )
$x integer
$y integer
$z integer

canBlockSeeSky() public method

public canBlockSeeSky ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
return boolean

cancelUnloadChunkRequest() public method

checkSleep() public method

public checkSleep ( )

checkTime() public method

Changes to this function won't be recorded on the version.
public checkTime ( )

chunkBlockHash() public static method

public static chunkBlockHash ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer

chunkHash() public static method

Returns the chunk unique hash/key
public static chunkHash ( integer $x, integer $z ) : string
$x integer
$z integer
return string

chunkRequestCallback() public method

public chunkRequestCallback ( $x, $z, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS )

clearCache() public method

public clearCache ( boolean $full = false )
$full boolean

clearChunkCache() public method

public clearChunkCache ( integer $chunkX, integer $chunkZ )
$chunkX integer
$chunkZ integer

close() public method

public close ( )

doChunkGarbageCollection() public method

doTick() public method

Changes to this function won't be recorded on the version.
public doTick ( integer $currentTick ) : boolean
$currentTick integer
return boolean

dropItem() public method

public dropItem ( Vector3 $source, Item $item, Vector3 $motion = null, integer $delay = 10 ) : null | Item
$source pocketmine\math\Vector3
$item pocketmine\item\Item
$motion pocketmine\math\Vector3
$delay integer
return null | pocketmine\entity\Item

generateChunk() public method

public generateChunk ( integer $x, integer $z, boolean $force = false )
$x integer
$z integer
$force boolean

generateChunkCallback() public method

public generateChunkCallback ( integer $x, integer $z, pocketmine\level\format\FullChunk $chunk )
$x integer
$z integer
$chunk pocketmine\level\format\FullChunk

generateChunkLoaderId() public static method

public static generateChunkLoaderId ( pocketmine\level\ChunkLoader $loader ) : integer
$loader pocketmine\level\ChunkLoader
return integer

getAutoSave() public method

public getAutoSave ( ) : boolean
return boolean

getBiomeColor() public method

public getBiomeColor ( integer $x, integer $z ) : array
$x integer
$z integer
return array

getBiomeId() public method

public getBiomeId ( integer $x, integer $z ) : integer
$x integer
$z integer
return integer

getBlock() public method

Gets the Block object on the Vector3 location
public getBlock ( Vector3 $pos, boolean $cached = true ) : Block
$pos pocketmine\math\Vector3
$cached boolean
return pocketmine\block\Block

getBlockDataAt() public method

Gets the raw block metadata
public getBlockDataAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer 0-15

getBlockExtraDataAt() public method

Gets the raw block extra data
public getBlockExtraDataAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer 16-bit

getBlockIdAt() public method

Gets the raw block id.
public getBlockIdAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer 0-255

getBlockLightAt() public method

Gets the raw block light level
public getBlockLightAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer 0-15

getBlockMetadata() public method

public getBlockMetadata ( ) : BlockMetadataStore
return pocketmine\metadata\BlockMetadataStore

getBlockSkyLightAt() public method

Gets the raw block skylight level
public getBlockSkyLightAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer 0-15

getBlockTempData() public method

This method is internal use only. Do not use this in plugins
public getBlockTempData ( Vector3 $pos ) : integer
$pos pocketmine\math\Vector3
return integer

getBlockXYZ() public static method

public static getBlockXYZ ( $hash, &$x, &$y, &$z )

getChunk() public method

Gets the Chunk object
public getChunk ( integer $x, integer $z, boolean $create = false ) : pocketmine\level\format\FullChunk | pocketmine\level\format\Chunk
$x integer
$z integer
$create boolean Whether to generate the chunk if it does not exist
return pocketmine\level\format\FullChunk | pocketmine\level\format\Chunk

getChunkEntities() public method

Returns a list of the entities on a given chunk
public getChunkEntities ( integer $X, integer $Z ) : array
$X integer
$Z integer
return array

getChunkLoaders() public method

Gets the chunk loaders being used in a specific chunk
public getChunkLoaders ( integer $chunkX, integer $chunkZ ) : array
$chunkX integer
$chunkZ integer
return array

getChunkPlayers() public method

Gets the players being used in a specific chunk
public getChunkPlayers ( integer $chunkX, integer $chunkZ ) : array
$chunkX integer
$chunkZ integer
return array

getChunkTiles() public method

Gives a list of the Tile entities on a given chunk
public getChunkTiles ( integer $X, integer $Z ) : array
$X integer
$Z integer
return array

getChunks() public method

public getChunks ( ) : array
return array

getCollidingEntities() public method

Returns the entities colliding the current one inside the AxisAlignedBB
public getCollidingEntities ( AxisAlignedBB $bb, Entity $entity = null ) : array
$bb pocketmine\math\AxisAlignedBB
$entity pocketmine\entity\Entity
return array

getCollisionBlocks() public method

public getCollisionBlocks ( AxisAlignedBB $bb, boolean $targetFirst = false ) : array
$bb pocketmine\math\AxisAlignedBB
$targetFirst boolean
return array

getCollisionCubes() public method

public getCollisionCubes ( Entity $entity, AxisAlignedBB $bb, boolean $entities = true ) : array
$entity pocketmine\entity\Entity
$bb pocketmine\math\AxisAlignedBB
$entities boolean
return array

getDimension() public method

public getDimension ( ) : integer
return integer

getEntities() public method

Gets the list of all the entities in this level
public getEntities ( ) : array
return array

getEntity() public method

public getEntity ( integer $entityId ) : Entity
$entityId integer
return pocketmine\entity\Entity

getFolderName() public method

Returns the Level folder name
public getFolderName ( ) : string
return string

getFullBlock() public method

public getFullBlock ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
return integer bitmap, (id << 4) | data

getFullLight() public method

$block = $this->getBlock(Vector3::createVector($x1, $y1, $z1)); if(!$flag1 or $block->getBoundingBox() !== null){ $ob = $block->calculateIntercept($pos1, $pos2); if($ob !== null){ return $ob; } } $movingObjectPosition = null; $k = 200; while($k-- >= 0){ if(is_nan($pos1->x) or is_nan($pos1->y) or is_nan($pos1->z)){ return null; } if($x1 === $x2 and $y1 === $y2 and $z1 === $z2){ return $flag2 ? $movingObjectPosition : null; } $flag3 = true; $flag4 = true; $flag5 = true; $i = 999; $j = 999; $k = 999; if($x1 > $x2){ $i = $x2 + 1; }elseif($x1 < $x2){ $i = $x2; }else{ $flag3 = false; } if($y1 > $y2){ $j = $y2 + 1; }elseif($y1 < $y2){ $j = $y2; }else{ $flag4 = false; } if($z1 > $z2){ $k = $z2 + 1; }elseif($z1 < $z2){ $k = $z2; }else{ $flag5 = false; } TODO } } } }
public getFullLight ( Vector3 $pos ) : integer
$pos pocketmine\math\Vector3
return integer

getHeightMap() public method

public getHeightMap ( integer $x, integer $z ) : integer
$x integer
$z integer
return integer

getHighestBlockAt() public method

Gets the highest block Y value at a specific $x and $z
public getHighestBlockAt ( integer $x, integer $z ) : integer
$x integer
$z integer
return integer 0-127

getId() final public method

Returns the unique level identifier
final public getId ( ) : integer
return integer

getLoaders() public method

public getLoaders ( ) : array
return array

getMetadata() public method

public getMetadata ( $metadataKey )

getName() public method

Returns the Level name
public getName ( ) : string
return string

getNearbyEntities() public method

Returns the entities near the current one inside the AxisAlignedBB
public getNearbyEntities ( AxisAlignedBB $bb, Entity $entity = null ) : array
$bb pocketmine\math\AxisAlignedBB
$entity pocketmine\entity\Entity
return array

getNearbyExperienceOrb() public method

public getNearbyExperienceOrb ( AxisAlignedBB $bb ) : array
$bb pocketmine\math\AxisAlignedBB
return array

getPlayers() public method

Returns a list of the players in this level
public getPlayers ( ) : array
return array

getProvider() final public method

final public getProvider ( ) : pocketmine\level\format\LevelProvider
return pocketmine\level\format\LevelProvider

getSafeSpawn() public method

public getSafeSpawn ( Vector3 $spawn = null ) : boolean | Position
$spawn pocketmine\math\Vector3 default null
return boolean | Position

getSeed() public method

Gets the level seed
public getSeed ( ) : integer | string
return integer | string

getServer() public method

public getServer ( ) : Server
return pocketmine\Server

getSpawnLocation() public method

Returns a Position pointing to the spawn
public getSpawnLocation ( ) : Position
return Position

getTickRate() public method

public getTickRate ( ) : integer
return integer

getTickRateTime() public method

public getTickRateTime ( )

getTile() public method

Returns the Tile in a position, or null if not found
public getTile ( Vector3 $pos ) : Tile
$pos pocketmine\math\Vector3
return pocketmine\tile\Tile

getTileById() public method

public getTileById ( integer $tileId ) : Tile
$tileId integer
return pocketmine\tile\Tile

getTiles() public method

Returns a list of the Tile entities in this level
public getTiles ( ) : array
return array

getTime() public method

Gets the current time
public getTime ( ) : integer
return integer

getWaterHeight() public method

public getWaterHeight ( ) : integer
return integer

getWeather() public method

public getWeather ( ) : Weather
return pocketmine\level\weather\Weather

getXZ() public static method

public static getXZ ( $hash, &$x, &$z )

hasMetadata() public method

public hasMetadata ( $metadataKey )

initLevel() public method

public initLevel ( )

isChunkGenerated() public method

public isChunkGenerated ( integer $x, integer $z ) : boolean
$x integer
$z integer
return boolean

isChunkInUse() public method

public isChunkInUse ( integer $x, integer $z ) : boolean
$x integer
$z integer
return boolean

isChunkLoaded() public method

public isChunkLoaded ( integer $x, integer $z ) : boolean
$x integer
$z integer
return boolean

isChunkPopulated() public method

public isChunkPopulated ( integer $x, integer $z ) : boolean
$x integer
$z integer
return boolean

isFullBlock() public method

public isFullBlock ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
return boolean

isSpawnChunk() public method

Returns true if the spawn is part of the spawn
public isSpawnChunk ( integer $X, integer $Z ) : boolean
$X integer
$Z integer
return boolean

loadChunk() public method

public loadChunk ( integer $x, integer $z, boolean $generate = true ) : boolean
$x integer
$z integer
$generate boolean
return boolean

populateChunk() public method

public populateChunk ( integer $x, integer $z, boolean $force = false ) : boolean
$x integer
$z integer
$force boolean
return boolean

regenerateChunk() public method

public regenerateChunk ( integer $x, integer $z )
$x integer
$z integer

registerChunkLoader() public method

public registerChunkLoader ( pocketmine\level\ChunkLoader $loader, integer $chunkX, integer $chunkZ, boolean $autoLoad = true )
$loader pocketmine\level\ChunkLoader
$chunkX integer
$chunkZ integer
$autoLoad boolean

registerGenerator() public method

public registerGenerator ( )

removeEntity() public method

Removes the entity from the level index
public removeEntity ( Entity $entity )
$entity pocketmine\entity\Entity

removeMetadata() public method

public removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
$plugin pocketmine\plugin\Plugin

removeTile() public method

public removeTile ( Tile $tile )
$tile pocketmine\tile\Tile

requestChunk() public method

public requestChunk ( integer $x, integer $z, Player $player )
$x integer
$z integer
$player pocketmine\Player

save() public method

public save ( boolean $force = false ) : boolean
$force boolean
return boolean

saveChunks() public method

public saveChunks ( )

scheduleUpdate() public method

public scheduleUpdate ( Vector3 $pos, integer $delay )
$pos pocketmine\math\Vector3
$delay integer

sendBlockExtraData() public method

public sendBlockExtraData ( integer $x, integer $y, integer $z, integer $id, integer $data, array $targets = null )
$x integer
$y integer
$z integer
$id integer
$data integer
$targets array

sendBlocks() public method

public sendBlocks ( array $target, array $blocks, integer $flags = UpdateBlockPacket::FLAG_NONE, boolean $optimizeRebuilds = false )
$target array
$blocks array
$flags integer
$optimizeRebuilds boolean

sendLighting() public method

Directly send a lightning to a player
Deprecation:
public sendLighting ( integer $x, integer $y, integer $z, Player $p )
$x integer
$y integer
$z integer
$p pocketmine\Player

sendTime() public method

Changes to this function won't be recorded on the version.
public sendTime ( )

setAutoSave() public method

public setAutoSave ( boolean $value )
$value boolean

setBiomeColor() public method

public setBiomeColor ( integer $x, integer $z, integer $R, integer $G, integer $B )
$x integer
$z integer
$R integer
$G integer
$B integer

setBiomeId() public method

public setBiomeId ( integer $x, integer $z, integer $biomeId )
$x integer
$z integer
$biomeId integer

setBlock() public method

If $direct is true, it'll send changes directly to players. if false, it'll be queued and the best way to send queued changes will be done in the next tick. This way big changes can be sent on a single chunk update packet instead of thousands of packets. If $update is true, it'll get the neighbour blocks (6 sides) and update them. If you are doing big changes, you might want to set this to false, then update manually.
public setBlock ( Vector3 $pos, Block $block, boolean $direct = false, boolean $update = true ) : boolean
$pos pocketmine\math\Vector3
$block pocketmine\block\Block
$direct boolean @deprecated
$update boolean
return boolean Whether the block has been updated or not

setBlockDataAt() public method

Sets the raw block metadata.
public setBlockDataAt ( integer $x, integer $y, integer $z, integer $data )
$x integer
$y integer
$z integer
$data integer 0-15

setBlockExtraDataAt() public method

Sets the raw block metadata.
public setBlockExtraDataAt ( integer $x, integer $y, integer $z, integer $id, integer $data )
$x integer
$y integer
$z integer
$id integer
$data integer

setBlockIdAt() public method

Sets the raw block id.
public setBlockIdAt ( integer $x, integer $y, integer $z, integer $id )
$x integer
$y integer
$z integer
$id integer 0-255

setBlockLightAt() public method

Sets the raw block light level.
public setBlockLightAt ( integer $x, integer $y, integer $z, integer $level )
$x integer
$y integer
$z integer
$level integer 0-15

setBlockSkyLightAt() public method

Sets the raw block skylight level.
public setBlockSkyLightAt ( integer $x, integer $y, integer $z, integer $level )
$x integer
$y integer
$z integer
$level integer 0-15

setBlockTempData() public method

This method is internal use only. Do not use this in plugins
public setBlockTempData ( Vector3 $pos, $data = null )
$pos pocketmine\math\Vector3
$data

setChunk() public method

public setChunk ( integer $chunkX, integer $chunkZ, pocketmine\level\format\FullChunk $chunk = null, boolean $unload = true )
$chunkX integer
$chunkZ integer
$chunk pocketmine\level\format\FullChunk
$unload boolean

setDimension() public method

public setDimension ( integer $dimension )
$dimension integer

setHeightMap() public method

public setHeightMap ( integer $x, integer $z, integer $value )
$x integer
$z integer
$value integer

setMetadata() public method

public setMetadata ( $metadataKey, MetadataValue $metadataValue )
$metadataValue pocketmine\metadata\MetadataValue

setSeed() public method

Sets the seed for the level
public setSeed ( integer $seed )
$seed integer

setSpawnLocation() public method

Sets the level spawn location
public setSpawnLocation ( Vector3 $pos )
$pos pocketmine\math\Vector3

setTickRate() public method

public setTickRate ( integer $tickRate )
$tickRate integer

setTime() public method

Sets the current time on the level
public setTime ( integer $time )
$time integer

spawnLightning() public method

Add a lightning
public spawnLightning ( Vector3 $pos ) : Lightning
$pos pocketmine\math\Vector3
return pocketmine\entity\Lightning

spawnXPOrb() public method

Add an experience orb
public spawnXPOrb ( Vector3 $pos, integer $exp = 1 ) : boolean | XPOrb
$pos pocketmine\math\Vector3
$exp integer
return boolean | pocketmine\entity\XPOrb

startTime() public method

Start the time again, if it was stopped
public startTime ( )

stopTime() public method

Stops the time for the level, will not save the lock state to disk
public stopTime ( )

unload() public method

Unloads the current level from memory safely
public unload ( boolean $force = false ) : boolean
$force boolean default false, force unload of default level
return boolean

unloadChunk() public method

public unloadChunk ( integer $x, integer $z, boolean $safe = true, boolean $trySave = true ) : boolean
$x integer
$z integer
$safe boolean
$trySave boolean
return boolean

unloadChunkRequest() public method

public unloadChunkRequest ( integer $x, integer $z, boolean $safe = true ) : boolean
$x integer
$z integer
$safe boolean
return boolean

unloadChunks() public method

public unloadChunks ( boolean $force = false )
$force boolean

unregisterChunkLoader() public method

public unregisterChunkLoader ( pocketmine\level\ChunkLoader $loader, integer $chunkX, integer $chunkZ )
$loader pocketmine\level\ChunkLoader
$chunkX integer
$chunkZ integer

unregisterGenerator() public method

public unregisterGenerator ( )

updateAllLight() public method

public updateAllLight ( Vector3 $pos )
$pos pocketmine\math\Vector3

updateAround() public method

public updateAround ( Vector3 $pos )
$pos pocketmine\math\Vector3

updateBlockLight() public method

public updateBlockLight ( integer $x, integer $y, integer $z )
$x integer
$y integer
$z integer

updateBlockSkyLight() public method

useBreakOn() public method

Tries to break a block using a item, including Player time checks if available It'll try to lower the durability if Item is a tool, and set it to Air if broken.
public useBreakOn ( Vector3 $vector, Item &$item = null, Player $player = null, boolean $createParticles = false ) : boolean
$vector pocketmine\math\Vector3
$item pocketmine\item\Item
$player pocketmine\Player
$createParticles boolean
return boolean

useItemOn() public method

Uses a item on a position and face, placing it or activating the block
public useItemOn ( Vector3 $vector, Item &$item, integer $face, float $fx, float $fy, float $fz, Player $player = null ) : boolean
$vector pocketmine\math\Vector3
$item pocketmine\item\Item
$face integer
$fx float default 0.0
$fy float default 0.0
$fz float default 0.0
$player pocketmine\Player default null
return boolean

Property Details

$COMPRESSION_LEVEL public_oe static_oe property

public static $COMPRESSION_LEVEL

$sleepTicks public_oe property

public $sleepTicks

$stopTime public_oe property

public $stopTime

$tickRateCounter public_oe property

public $tickRateCounter

$tickRateTime public_oe property

public $tickRateTime

$timings public_oe property

public LevelTimings,pocketmine\event $timings
return pocketmine\event\LevelTimings

$updateEntities public_oe property

public Entity[],pocketmine\entity $updateEntities
return pocketmine\entity\Entity[]

$updateTiles public_oe property

public Tile[],pocketmine\tile $updateTiles
return pocketmine\tile\Tile[]