PHP Класс pocketmine\level\Level

Наследование: implements pocketmine\level\ChunkManager, implements pocketmine\metadata\Metadatable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$COMPRESSION_LEVEL
$sleepTicks
$stopTime
$tickRateCounter
$tickRateTime
$timings pocketmine\event\LevelTimings
$updateEntities pocketmine\entity\Entity[]
$updateTiles pocketmine\tile\Tile[]

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
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 ( )

Описание методов

__construct() публичный Метод

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 __debugInfo ( ) : array
Результат array

addChunkPacket() публичный Метод

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

addEntity() публичный Метод

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

addEntityMotion() публичный Метод

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 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 addParticle ( Particle $particle, array $players = null )
$particle pocketmine\level\particle\Particle
$players array

addPlayerMovement() публичный Метод

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

addSound() публичный Метод

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

addTile() публичный Метод

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

blockHash() публичный статический Метод

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

canBlockSeeSky() публичный Метод

public canBlockSeeSky ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
Результат boolean

cancelUnloadChunkRequest() публичный Метод

checkSleep() публичный Метод

public checkSleep ( )

checkTime() публичный Метод

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

chunkBlockHash() публичный статический Метод

public static chunkBlockHash ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer

chunkHash() публичный статический Метод

Returns the chunk unique hash/key
public static chunkHash ( integer $x, integer $z ) : string
$x integer
$z integer
Результат string

chunkRequestCallback() публичный Метод

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

clearCache() публичный Метод

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

clearChunkCache() публичный Метод

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

close() публичный Метод

public close ( )

doChunkGarbageCollection() публичный Метод

doTick() публичный Метод

Changes to this function won't be recorded on the version.
public doTick ( integer $currentTick ) : boolean
$currentTick integer
Результат boolean

dropItem() публичный Метод

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
Результат null | pocketmine\entity\Item

generateChunk() публичный Метод

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

generateChunkCallback() публичный Метод

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

generateChunkLoaderId() публичный статический Метод

public static generateChunkLoaderId ( pocketmine\level\ChunkLoader $loader ) : integer
$loader pocketmine\level\ChunkLoader
Результат integer

getAutoSave() публичный Метод

public getAutoSave ( ) : boolean
Результат boolean

getBiomeColor() публичный Метод

public getBiomeColor ( integer $x, integer $z ) : array
$x integer
$z integer
Результат array

getBiomeId() публичный Метод

public getBiomeId ( integer $x, integer $z ) : integer
$x integer
$z integer
Результат integer

getBlock() публичный Метод

Gets the Block object on the Vector3 location
public getBlock ( Vector3 $pos, boolean $cached = true ) : Block
$pos pocketmine\math\Vector3
$cached boolean
Результат pocketmine\block\Block

getBlockDataAt() публичный Метод

Gets the raw block metadata
public getBlockDataAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer 0-15

getBlockExtraDataAt() публичный Метод

Gets the raw block extra data
public getBlockExtraDataAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer 16-bit

getBlockIdAt() публичный Метод

Gets the raw block id.
public getBlockIdAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer 0-255

getBlockLightAt() публичный Метод

Gets the raw block light level
public getBlockLightAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer 0-15

getBlockMetadata() публичный Метод

public getBlockMetadata ( ) : BlockMetadataStore
Результат pocketmine\metadata\BlockMetadataStore

getBlockSkyLightAt() публичный Метод

Gets the raw block skylight level
public getBlockSkyLightAt ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer 0-15

getBlockTempData() публичный Метод

This method is internal use only. Do not use this in plugins
public getBlockTempData ( Vector3 $pos ) : integer
$pos pocketmine\math\Vector3
Результат integer

getBlockXYZ() публичный статический Метод

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

getChunk() публичный Метод

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
Результат pocketmine\level\format\FullChunk | pocketmine\level\format\Chunk

getChunkEntities() публичный Метод

Returns a list of the entities on a given chunk
public getChunkEntities ( integer $X, integer $Z ) : array
$X integer
$Z integer
Результат array

getChunkLoaders() публичный Метод

Gets the chunk loaders being used in a specific chunk
public getChunkLoaders ( integer $chunkX, integer $chunkZ ) : array
$chunkX integer
$chunkZ integer
Результат array

getChunkPlayers() публичный Метод

Gets the players being used in a specific chunk
public getChunkPlayers ( integer $chunkX, integer $chunkZ ) : array
$chunkX integer
$chunkZ integer
Результат array

getChunkTiles() публичный Метод

Gives a list of the Tile entities on a given chunk
public getChunkTiles ( integer $X, integer $Z ) : array
$X integer
$Z integer
Результат array

getChunks() публичный Метод

public getChunks ( ) : array
Результат array

getCollidingEntities() публичный Метод

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
Результат array

getCollisionBlocks() публичный Метод

public getCollisionBlocks ( AxisAlignedBB $bb, boolean $targetFirst = false ) : array
$bb pocketmine\math\AxisAlignedBB
$targetFirst boolean
Результат array

getCollisionCubes() публичный Метод

public getCollisionCubes ( Entity $entity, AxisAlignedBB $bb, boolean $entities = true ) : array
$entity pocketmine\entity\Entity
$bb pocketmine\math\AxisAlignedBB
$entities boolean
Результат array

getDimension() публичный Метод

public getDimension ( ) : integer
Результат integer

getEntities() публичный Метод

Gets the list of all the entities in this level
public getEntities ( ) : array
Результат array

getEntity() публичный Метод

public getEntity ( integer $entityId ) : Entity
$entityId integer
Результат pocketmine\entity\Entity

getFolderName() публичный Метод

Returns the Level folder name
public getFolderName ( ) : string
Результат string

getFullBlock() публичный Метод

public getFullBlock ( integer $x, integer $y, integer $z ) : integer
$x integer
$y integer
$z integer
Результат integer bitmap, (id << 4) | data

getFullLight() публичный Метод

$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
Результат integer

getHeightMap() публичный Метод

public getHeightMap ( integer $x, integer $z ) : integer
$x integer
$z integer
Результат integer

getHighestBlockAt() публичный Метод

Gets the highest block Y value at a specific $x and $z
public getHighestBlockAt ( integer $x, integer $z ) : integer
$x integer
$z integer
Результат integer 0-127

getId() закрытый публичный Метод

Returns the unique level identifier
final public getId ( ) : integer
Результат integer

getLoaders() публичный Метод

public getLoaders ( ) : array
Результат array

getMetadata() публичный Метод

public getMetadata ( $metadataKey )

getName() публичный Метод

Returns the Level name
public getName ( ) : string
Результат string

getNearbyEntities() публичный Метод

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
Результат array

getNearbyExperienceOrb() публичный Метод

public getNearbyExperienceOrb ( AxisAlignedBB $bb ) : array
$bb pocketmine\math\AxisAlignedBB
Результат array

getPlayers() публичный Метод

Returns a list of the players in this level
public getPlayers ( ) : array
Результат array

getProvider() закрытый публичный Метод

final public getProvider ( ) : pocketmine\level\format\LevelProvider
Результат pocketmine\level\format\LevelProvider

getSafeSpawn() публичный Метод

public getSafeSpawn ( Vector3 $spawn = null ) : boolean | Position
$spawn pocketmine\math\Vector3 default null
Результат boolean | Position

getSeed() публичный Метод

Gets the level seed
public getSeed ( ) : integer | string
Результат integer | string

getServer() публичный Метод

public getServer ( ) : Server
Результат pocketmine\Server

getSpawnLocation() публичный Метод

Returns a Position pointing to the spawn
public getSpawnLocation ( ) : Position
Результат Position

getTickRate() публичный Метод

public getTickRate ( ) : integer
Результат integer

getTickRateTime() публичный Метод

public getTickRateTime ( )

getTile() публичный Метод

Returns the Tile in a position, or null if not found
public getTile ( Vector3 $pos ) : Tile
$pos pocketmine\math\Vector3
Результат pocketmine\tile\Tile

getTileById() публичный Метод

public getTileById ( integer $tileId ) : Tile
$tileId integer
Результат pocketmine\tile\Tile

getTiles() публичный Метод

Returns a list of the Tile entities in this level
public getTiles ( ) : array
Результат array

getTime() публичный Метод

Gets the current time
public getTime ( ) : integer
Результат integer

getWaterHeight() публичный Метод

public getWaterHeight ( ) : integer
Результат integer

getWeather() публичный Метод

public getWeather ( ) : Weather
Результат pocketmine\level\weather\Weather

getXZ() публичный статический Метод

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

hasMetadata() публичный Метод

public hasMetadata ( $metadataKey )

initLevel() публичный Метод

public initLevel ( )

isChunkGenerated() публичный Метод

public isChunkGenerated ( integer $x, integer $z ) : boolean
$x integer
$z integer
Результат boolean

isChunkInUse() публичный Метод

public isChunkInUse ( integer $x, integer $z ) : boolean
$x integer
$z integer
Результат boolean

isChunkLoaded() публичный Метод

public isChunkLoaded ( integer $x, integer $z ) : boolean
$x integer
$z integer
Результат boolean

isChunkPopulated() публичный Метод

public isChunkPopulated ( integer $x, integer $z ) : boolean
$x integer
$z integer
Результат boolean

isFullBlock() публичный Метод

public isFullBlock ( Vector3 $pos ) : boolean
$pos pocketmine\math\Vector3
Результат boolean

isSpawnChunk() публичный Метод

Returns true if the spawn is part of the spawn
public isSpawnChunk ( integer $X, integer $Z ) : boolean
$X integer
$Z integer
Результат boolean

loadChunk() публичный Метод

public loadChunk ( integer $x, integer $z, boolean $generate = true ) : boolean
$x integer
$z integer
$generate boolean
Результат boolean

populateChunk() публичный Метод

public populateChunk ( integer $x, integer $z, boolean $force = false ) : boolean
$x integer
$z integer
$force boolean
Результат boolean

regenerateChunk() публичный Метод

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

registerChunkLoader() публичный Метод

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 registerGenerator ( )

removeEntity() публичный Метод

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

removeMetadata() публичный Метод

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

removeTile() публичный Метод

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

requestChunk() публичный Метод

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

save() публичный Метод

public save ( boolean $force = false ) : boolean
$force boolean
Результат boolean

saveChunks() публичный Метод

public saveChunks ( )

scheduleUpdate() публичный Метод

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

sendBlockExtraData() публичный Метод

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 sendBlocks ( array $target, array $blocks, integer $flags = UpdateBlockPacket::FLAG_NONE, boolean $optimizeRebuilds = false )
$target array
$blocks array
$flags integer
$optimizeRebuilds boolean

sendLighting() публичный Метод

Directly send a lightning to a player
Устаревший:
public sendLighting ( integer $x, integer $y, integer $z, Player $p )
$x integer
$y integer
$z integer
$p pocketmine\Player

sendTime() публичный Метод

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

setAutoSave() публичный Метод

public setAutoSave ( boolean $value )
$value boolean

setBiomeColor() публичный Метод

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

setBiomeId() публичный Метод

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

setBlock() публичный Метод

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
Результат boolean Whether the block has been updated or not

setBlockDataAt() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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 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 setDimension ( integer $dimension )
$dimension integer

setHeightMap() публичный Метод

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

setMetadata() публичный Метод

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

setSeed() публичный Метод

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

setSpawnLocation() публичный Метод

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

setTickRate() публичный Метод

public setTickRate ( integer $tickRate )
$tickRate integer

setTime() публичный Метод

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

spawnLightning() публичный Метод

Add a lightning
public spawnLightning ( Vector3 $pos ) : Lightning
$pos pocketmine\math\Vector3
Результат pocketmine\entity\Lightning

spawnXPOrb() публичный Метод

Add an experience orb
public spawnXPOrb ( Vector3 $pos, integer $exp = 1 ) : boolean | XPOrb
$pos pocketmine\math\Vector3
$exp integer
Результат boolean | pocketmine\entity\XPOrb

startTime() публичный Метод

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

stopTime() публичный Метод

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

unload() публичный Метод

Unloads the current level from memory safely
public unload ( boolean $force = false ) : boolean
$force boolean default false, force unload of default level
Результат boolean

unloadChunk() публичный Метод

public unloadChunk ( integer $x, integer $z, boolean $safe = true, boolean $trySave = true ) : boolean
$x integer
$z integer
$safe boolean
$trySave boolean
Результат boolean

unloadChunkRequest() публичный Метод

public unloadChunkRequest ( integer $x, integer $z, boolean $safe = true ) : boolean
$x integer
$z integer
$safe boolean
Результат boolean

unloadChunks() публичный Метод

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

unregisterChunkLoader() публичный Метод

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

unregisterGenerator() публичный Метод

public unregisterGenerator ( )

updateAllLight() публичный Метод

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

updateAround() публичный Метод

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

updateBlockLight() публичный Метод

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

updateBlockSkyLight() публичный Метод

useBreakOn() публичный Метод

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
Результат boolean

useItemOn() публичный Метод

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
Результат boolean

Описание свойств

$COMPRESSION_LEVEL публичное статическое свойство

public static $COMPRESSION_LEVEL

$sleepTicks публичное свойство

public $sleepTicks

$stopTime публичное свойство

public $stopTime

$tickRateCounter публичное свойство

public $tickRateCounter

$tickRateTime публичное свойство

public $tickRateTime

$timings публичное свойство

public LevelTimings,pocketmine\event $timings
Результат pocketmine\event\LevelTimings

$updateEntities публичное свойство

public Entity[],pocketmine\entity $updateEntities
Результат pocketmine\entity\Entity[]

$updateTiles публичное свойство

public Tile[],pocketmine\tile $updateTiles
Результат pocketmine\tile\Tile[]