PHP Class pocketmine\level\Level

Inheritance: implements pocketmine\level\ChunkManager, implements pocketmine\metadata\Metadatable
Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$COMPRESSION_LEVEL
$sleepTicks
$stopTime
$tickRateCounter
$tickRateTime
$timings pocketmine\event\LevelTimings
$updateEntities pocketmine\entity\Entity[]
$updateTiles pocketmine\tile\Tile[]

Méthodes publiques

Méthode 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

Méthode 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 méthode

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 méthode

public __debugInfo ( ) : array
Résultat array

addChunkPacket() public méthode

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

addEntity() public méthode

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

addEntityMotion() public méthode

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 méthode

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 méthode

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

addPlayerMovement() public méthode

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

addSound() public méthode

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

addTile() public méthode

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

blockHash() public static méthode

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

canBlockSeeSky() public méthode

public canBlockSeeSky ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
Résultat boolean

cancelUnloadChunkRequest() public méthode

checkSleep() public méthode

public checkSleep ( )

checkTime() public méthode

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

chunkBlockHash() public static méthode

public static chunkBlockHash ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Résultat integer

chunkHash() public static méthode

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

chunkRequestCallback() public méthode

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

clearCache() public méthode

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

clearChunkCache() public méthode

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

close() public méthode

public close ( )

doChunkGarbageCollection() public méthode

doTick() public méthode

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

dropItem() public méthode

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
Résultat null | pocketmine\entity\Item

generateChunk() public méthode

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

generateChunkCallback() public méthode

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

generateChunkLoaderId() public static méthode

public static generateChunkLoaderId ( pocketmine\level\ChunkLoader $loader ) : integer
$loader pocketmine\level\ChunkLoader
Résultat integer

getAutoSave() public méthode

public getAutoSave ( ) : boolean
Résultat boolean

getBiomeColor() public méthode

public getBiomeColor ( integer $x, integer $z ) : array
$x integer
$z integer
Résultat array

getBiomeId() public méthode

public getBiomeId ( integer $x, integer $z ) : integer
$x integer
$z integer
Résultat integer

getBlock() public méthode

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

getBlockDataAt() public méthode

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

getBlockExtraDataAt() public méthode

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

getBlockIdAt() public méthode

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

getBlockLightAt() public méthode

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

getBlockMetadata() public méthode

public getBlockMetadata ( ) : BlockMetadataStore
Résultat pocketmine\metadata\BlockMetadataStore

getBlockSkyLightAt() public méthode

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

getBlockTempData() public méthode

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

getBlockXYZ() public static méthode

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

getChunk() public méthode

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
Résultat pocketmine\level\format\FullChunk | pocketmine\level\format\Chunk

getChunkEntities() public méthode

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

getChunkLoaders() public méthode

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

getChunkPlayers() public méthode

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

getChunkTiles() public méthode

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

getChunks() public méthode

public getChunks ( ) : array
Résultat array

getCollidingEntities() public méthode

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
Résultat array

getCollisionBlocks() public méthode

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

getCollisionCubes() public méthode

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

getDimension() public méthode

public getDimension ( ) : integer
Résultat integer

getEntities() public méthode

Gets the list of all the entities in this level
public getEntities ( ) : array
Résultat array

getEntity() public méthode

public getEntity ( integer $entityId ) : Entity
$entityId integer
Résultat pocketmine\entity\Entity

getFolderName() public méthode

Returns the Level folder name
public getFolderName ( ) : string
Résultat string

getFullBlock() public méthode

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

getFullLight() public méthode

$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
Résultat integer

getHeightMap() public méthode

public getHeightMap ( integer $x, integer $z ) : integer
$x integer
$z integer
Résultat integer

getHighestBlockAt() public méthode

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

getId() final public méthode

Returns the unique level identifier
final public getId ( ) : integer
Résultat integer

getLoaders() public méthode

public getLoaders ( ) : array
Résultat array

getMetadata() public méthode

public getMetadata ( $metadataKey )

getName() public méthode

Returns the Level name
public getName ( ) : string
Résultat string

getNearbyEntities() public méthode

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
Résultat array

getNearbyExperienceOrb() public méthode

public getNearbyExperienceOrb ( AxisAlignedBB $bb ) : array
$bb pocketmine\math\AxisAlignedBB
Résultat array

getPlayers() public méthode

Returns a list of the players in this level
public getPlayers ( ) : array
Résultat array

getProvider() final public méthode

final public getProvider ( ) : pocketmine\level\format\LevelProvider
Résultat pocketmine\level\format\LevelProvider

getSafeSpawn() public méthode

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

getSeed() public méthode

Gets the level seed
public getSeed ( ) : integer | string
Résultat integer | string

getServer() public méthode

public getServer ( ) : Server
Résultat pocketmine\Server

getSpawnLocation() public méthode

Returns a Position pointing to the spawn
public getSpawnLocation ( ) : Position
Résultat Position

getTickRate() public méthode

public getTickRate ( ) : integer
Résultat integer

getTickRateTime() public méthode

public getTickRateTime ( )

getTile() public méthode

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

getTileById() public méthode

public getTileById ( integer $tileId ) : Tile
$tileId integer
Résultat pocketmine\tile\Tile

getTiles() public méthode

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

getTime() public méthode

Gets the current time
public getTime ( ) : integer
Résultat integer

getWaterHeight() public méthode

public getWaterHeight ( ) : integer
Résultat integer

getWeather() public méthode

public getWeather ( ) : Weather
Résultat pocketmine\level\weather\Weather

getXZ() public static méthode

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

hasMetadata() public méthode

public hasMetadata ( $metadataKey )

initLevel() public méthode

public initLevel ( )

isChunkGenerated() public méthode

public isChunkGenerated ( integer $x, integer $z ) : boolean
$x integer
$z integer
Résultat boolean

isChunkInUse() public méthode

public isChunkInUse ( integer $x, integer $z ) : boolean
$x integer
$z integer
Résultat boolean

isChunkLoaded() public méthode

public isChunkLoaded ( integer $x, integer $z ) : boolean
$x integer
$z integer
Résultat boolean

isChunkPopulated() public méthode

public isChunkPopulated ( integer $x, integer $z ) : boolean
$x integer
$z integer
Résultat boolean

isFullBlock() public méthode

public isFullBlock ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
Résultat boolean

isSpawnChunk() public méthode

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

loadChunk() public méthode

public loadChunk ( integer $x, integer $z, boolean $generate = true ) : boolean
$x integer
$z integer
$generate boolean
Résultat boolean

populateChunk() public méthode

public populateChunk ( integer $x, integer $z, boolean $force = false ) : boolean
$x integer
$z integer
$force boolean
Résultat boolean

regenerateChunk() public méthode

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

registerChunkLoader() public méthode

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 méthode

public registerGenerator ( )

removeEntity() public méthode

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

removeMetadata() public méthode

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

removeTile() public méthode

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

requestChunk() public méthode

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

save() public méthode

public save ( boolean $force = false ) : boolean
$force boolean
Résultat boolean

saveChunks() public méthode

public saveChunks ( )

scheduleUpdate() public méthode

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

sendBlockExtraData() public méthode

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 méthode

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

sendLighting() public méthode

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 méthode

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

setAutoSave() public méthode

public setAutoSave ( boolean $value )
$value boolean

setBiomeColor() public méthode

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

setBiomeId() public méthode

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

setBlock() public méthode

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
Résultat boolean Whether the block has been updated or not

setBlockDataAt() public méthode

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 méthode

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 méthode

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 méthode

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 méthode

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 méthode

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 méthode

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 méthode

public setDimension ( integer $dimension )
$dimension integer

setHeightMap() public méthode

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

setMetadata() public méthode

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

setSeed() public méthode

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

setSpawnLocation() public méthode

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

setTickRate() public méthode

public setTickRate ( integer $tickRate )
$tickRate integer

setTime() public méthode

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

spawnLightning() public méthode

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

spawnXPOrb() public méthode

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

startTime() public méthode

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

stopTime() public méthode

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

unload() public méthode

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

unloadChunk() public méthode

public unloadChunk ( integer $x, integer $z, boolean $safe = true, boolean $trySave = true ) : boolean
$x integer
$z integer
$safe boolean
$trySave boolean
Résultat boolean

unloadChunkRequest() public méthode

public unloadChunkRequest ( integer $x, integer $z, boolean $safe = true ) : boolean
$x integer
$z integer
$safe boolean
Résultat boolean

unloadChunks() public méthode

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

unregisterChunkLoader() public méthode

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

unregisterGenerator() public méthode

public unregisterGenerator ( )

updateAllLight() public méthode

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

updateAround() public méthode

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

updateBlockLight() public méthode

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

updateBlockSkyLight() public méthode

useBreakOn() public méthode

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
Résultat boolean

useItemOn() public méthode

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
Résultat 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
Résultat pocketmine\event\LevelTimings

$updateEntities public_oe property

public Entity[],pocketmine\entity $updateEntities
Résultat pocketmine\entity\Entity[]

$updateTiles public_oe property

public Tile[],pocketmine\tile $updateTiles
Résultat pocketmine\tile\Tile[]