|
Genisys
Genisys API 1.9.3
A server software for Minecraft: Pocket Edition with many features
|
Public Member Functions | |
| __construct (int $chunkX, int $chunkZ, array $subChunks=[], array $entities=[], array $tiles=[], string $biomeIds="", array $heightMap=[]) | |
| getX () | |
| getZ () | |
| setX (int $x) | |
| setZ (int $z) | |
| getHeight () | |
| getFullBlock (int $x, int $y, int $z) | |
| setBlock (int $x, int $y, int $z, $blockId=null, $meta=null) | |
| getBlockId (int $x, int $y, int $z) | |
| setBlockId (int $x, int $y, int $z, int $id) | |
| getBlockData (int $x, int $y, int $z) | |
| setBlockData (int $x, int $y, int $z, int $data) | |
| getBlockExtraData (int $x, int $y, int $z) | |
| setBlockExtraData (int $x, int $y, int $z, int $data) | |
| getBlockSkyLight (int $x, int $y, int $z) | |
| setBlockSkyLight (int $x, int $y, int $z, int $level) | |
| getBlockLight (int $x, int $y, int $z) | |
| setBlockLight (int $x, int $y, int $z, int $level) | |
| getHighestBlockAt (int $x, int $z, bool $useHeightMap=true) | |
| getHeightMap (int $x, int $z) | |
| setHeightMap (int $x, int $z, int $value) | |
| recalculateHeightMap () | |
| populateSkyLight () | |
| getBiomeId (int $x, int $z) | |
| setBiomeId (int $x, int $z, int $biomeId) | |
| getBlockIdColumn (int $x, int $z) | |
| getBlockDataColumn (int $x, int $z) | |
| getBlockSkyLightColumn (int $x, int $z) | |
| getBlockLightColumn (int $x, int $z) | |
| isLightPopulated () | |
| setLightPopulated (bool $value=true) | |
| isPopulated () | |
| setPopulated (bool $value=true) | |
| isGenerated () | |
| setGenerated (bool $value=true) | |
| addEntity (Entity $entity) | |
| removeEntity (Entity $entity) | |
| addTile (Tile $tile) | |
| removeTile (Tile $tile) | |
| getEntities () | |
| getTiles () | |
| getTile (int $x, int $y, int $z) | |
| unload (bool $safe=true) | |
| initChunk (Level $level) | |
| getBiomeIdArray () | |
| getHeightMapArray () | |
| getBlockExtraDataArray () | |
| hasChanged () | |
| setChanged (bool $value=true) | |
| getSubChunk (int $y, bool $generateNew=false) | |
| setSubChunk (int $y, SubChunk $subChunk=null, bool $allowEmpty=false) | |
| getSubChunks () | |
| getHighestSubChunkIndex () | |
| getSubChunkSendCount () | |
| pruneEmptySubChunks () | |
| networkSerialize () | |
| fastSerialize () | |
Static Public Member Functions | |
| static | fastDeserialize (string $data) |
| static | getEmptyChunk (int $x, int $z) |
| static | chunkBlockHash (int $x, int $y, int $z) |
Data Fields | |
| const | MAX_SUBCHUNKS = 16 |
| __construct | ( | int | $chunkX, |
| int | $chunkZ, | ||
| array | $subChunks = [], |
||
| array | $entities = [], |
||
| array | $tiles = [], |
||
| string | $biomeIds = "", |
||
| array | $heightMap = [] |
||
| ) |
| int | $chunkX | |
| int | $chunkZ | |
| SubChunk[] | $subChunks | |
| CompoundTag[] | $entities | |
| CompoundTag[] | $tiles | |
| string | $biomeIds | |
| int[] | $heightMap |
| addEntity | ( | Entity | $entity | ) |
| Entity | $entity |
| addTile | ( | Tile | $tile | ) |
| Tile | $tile |
|
static |
Creates a block hash from chunk block coordinates. Used for extra data keys in chunk packets.
|
static |
| fastSerialize | ( | ) |
Fast-serializes the chunk for passing between threads TODO: tiles and entities
| getBiomeId | ( | int | $x, |
| int | $z | ||
| ) |
Returns the biome ID at the specified X/Z chunk block coordinates
| int | $x | 0-15 |
| int | $z | 0-15 |
| getBiomeIdArray | ( | ) |
| getBlockData | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the block meta value at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getBlockDataColumn | ( | int | $x, |
| int | $z | ||
| ) |
Returns a column of block meta values from bottom to top at the specified X/Z chunk block coordinates.
| int | $x | 0-15 |
| int | $z | 0-15 |
| getBlockExtraData | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the raw block extra data value at the specified chunk block coordinates, or 0 if no data exists
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getBlockExtraDataArray | ( | ) |
| getBlockId | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the block ID at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getBlockIdColumn | ( | int | $x, |
| int | $z | ||
| ) |
Returns a column of block IDs from bottom to top at the specified X/Z chunk block coordinates.
| int | $x | 0-15 |
| int | $z | 0-15 |
| getBlockLight | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the block light level at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | 0-15 |
| int | $z | 0-15 |
| getBlockLightColumn | ( | int | $x, |
| int | $z | ||
| ) |
Returns a column of block light values from bottom to top at the specified X/Z chunk block coordinates.
| int | $x | 0-15 |
| int | $z | 0-15 |
| getBlockSkyLight | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the sky light level at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getBlockSkyLightColumn | ( | int | $x, |
| int | $z | ||
| ) |
Returns a column of sky light values from bottom to top at the specified X/Z chunk block coordinates.
| int | $x | 0-15 |
| int | $z | 0-15 |
| getEntities | ( | ) |
Returns an array of entities currently using this chunk.
| getFullBlock | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns a bitmap of block ID and meta at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getHeight | ( | ) |
Returns the chunk height in count of subchunks.
| getHeightMap | ( | int | $x, |
| int | $z | ||
| ) |
Returns the heightmap value at the specified X/Z chunk block coordinates
| int | $x | 0-15 |
| int | $z | 0-15 |
| getHeightMapArray | ( | ) |
| getHighestBlockAt | ( | int | $x, |
| int | $z, | ||
| bool | $useHeightMap = true |
||
| ) |
Returns the Y coordinate of the highest non-air block at the specified X/Z chunk block coordinates
| int | $x | 0-15 |
| int | $z | 0-15 |
| bool | $useHeightMap | whether to use pre-calculated heightmap values or not |
| getHighestSubChunkIndex | ( | ) |
Returns the Y coordinate of the highest non-empty subchunk in this chunk.
| getSubChunk | ( | int | $y, |
| bool | $generateNew = false |
||
| ) |
Returns the subchunk at the specified subchunk Y coordinate, or an empty, unmodifiable stub if it does not exist or the coordinate is out of range.
| int | $y | |
| bool | $generateNew | Whether to create a new, modifiable subchunk if there is not one in place |
| getSubChunks | ( | ) |
| getSubChunkSendCount | ( | ) |
Returns the count of subchunks that need sending to players
| getTile | ( | int | $x, |
| int | $y, | ||
| int | $z | ||
| ) |
Returns the tile at the specified chunk block coordinates, or null if no tile exists.
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| getTiles | ( | ) |
| getX | ( | ) |
| getZ | ( | ) |
| hasChanged | ( | ) |
| isGenerated | ( | ) |
| isLightPopulated | ( | ) |
| isPopulated | ( | ) |
| networkSerialize | ( | ) |
Serializes the chunk for sending to players
| populateSkyLight | ( | ) |
Performs basic sky light population on the chunk.
TODO: rewrite this, use block light filters and diffusion, actual proper sky light population
| pruneEmptySubChunks | ( | ) |
Disposes of empty subchunks
| recalculateHeightMap | ( | ) |
Recalculates the heightmap for the whole chunk.
| removeEntity | ( | Entity | $entity | ) |
| Entity | $entity |
| removeTile | ( | Tile | $tile | ) |
| Tile | $tile |
| setBiomeId | ( | int | $x, |
| int | $z, | ||
| int | $biomeId | ||
| ) |
Sets the biome ID at the specified X/Z chunk block coordinates
| int | $x | 0-15 |
| int | $z | 0-15 |
| int | $biomeId | 0-255 |
| setBlock | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
$blockId = null, |
|||
$meta = null |
|||
| ) |
Sets block ID and meta in one call at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| int | null | $blockId | 0-255 if null, does not change |
| int | null | $meta | 0-15 if null, does not change |
| setBlockData | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
| int | $data | ||
| ) |
Sets the block meta value at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| int | $data | 0-15 |
| setBlockExtraData | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
| int | $data | ||
| ) |
Sets the raw block extra data value at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| int | $data | bitmap, (meta << 8) | id |
| setBlockId | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
| int | $id | ||
| ) |
Sets the block ID at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| int | $id | 0-255 |
| setBlockLight | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
| int | $level | ||
| ) |
Sets the block light level at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | 0-15 |
| int | $z | 0-15 |
| int | $level | 0-15 |
| setBlockSkyLight | ( | int | $x, |
| int | $y, | ||
| int | $z, | ||
| int | $level | ||
| ) |
Sets the sky light level at the specified chunk block coordinates
| int | $x | 0-15 |
| int | $y | |
| int | $z | 0-15 |
| int | $level | 0-15 |
| setChanged | ( | bool | $value = true | ) |
| bool | $value |
| setGenerated | ( | bool | $value = true | ) |
| bool | $value |
| setHeightMap | ( | int | $x, |
| int | $z, | ||
| int | $value | ||
| ) |
Returns the heightmap value at the specified X/Z chunk block coordinates
| int | $x | 0-15 |
| int | $z | 0-15 |
| int | $value |
| setLightPopulated | ( | bool | $value = true | ) |
| bool | $value |
| setPopulated | ( | bool | $value = true | ) |
| bool | $value |
| setSubChunk | ( | int | $y, |
| SubChunk | $subChunk = null, |
||
| bool | $allowEmpty = false |
||
| ) |
Sets a subchunk in the chunk index
| int | $y | |
| SubChunk | null | $subChunk | |
| bool | $allowEmpty | Whether to check if the chunk is empty, and if so replace it with an empty stub |
| setZ | ( | int | $z | ) |
| int | $z |
| unload | ( | bool | $safe = true | ) |
Unloads the chunk, closing entities and tiles.
| bool | $safe | Whether to check if there are still players using this chunk |