mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Chunk: update documentation
This commit is contained in:
parent
17fe894229
commit
b3e94ef1dc
@ -88,10 +88,10 @@ class Chunk{
|
|||||||
* Returns the internal ID of the blockstate at the given coordinates.
|
* Returns the internal ID of the blockstate at the given coordinates.
|
||||||
*
|
*
|
||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
* @param int $y 0-255
|
* @param int $y dependent on the height of the world
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
*
|
*
|
||||||
* @return int bitmap, (id << 4) | meta
|
* @return int the blockstate ID of the given block
|
||||||
*/
|
*/
|
||||||
public function getBlockStateId(int $x, int $y, int $z) : int{
|
public function getBlockStateId(int $x, int $y, int $z) : int{
|
||||||
return $this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBlockStateId($x, $y & SubChunk::COORD_MASK, $z);
|
return $this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBlockStateId($x, $y & SubChunk::COORD_MASK, $z);
|
||||||
@ -111,7 +111,7 @@ class Chunk{
|
|||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
*
|
*
|
||||||
* @return int|null 0-255, or null if there are no blocks in the column
|
* @return int|null the Y coordinate, or null if there are no blocks in the column
|
||||||
*/
|
*/
|
||||||
public function getHighestBlockAt(int $x, int $z) : ?int{
|
public function getHighestBlockAt(int $x, int $z) : ?int{
|
||||||
for($y = self::MAX_SUBCHUNK_INDEX; $y >= self::MIN_SUBCHUNK_INDEX; --$y){
|
for($y = self::MAX_SUBCHUNK_INDEX; $y >= self::MIN_SUBCHUNK_INDEX; --$y){
|
||||||
@ -148,9 +148,10 @@ class Chunk{
|
|||||||
* Returns the biome ID at the specified X/Z chunk block coordinates
|
* Returns the biome ID at the specified X/Z chunk block coordinates
|
||||||
*
|
*
|
||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
|
* @param int $y dependent on the height of the world
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
*
|
*
|
||||||
* @return int 0-255
|
* @see BiomeIds
|
||||||
*/
|
*/
|
||||||
public function getBiomeId(int $x, int $y, int $z) : int{
|
public function getBiomeId(int $x, int $y, int $z) : int{
|
||||||
return $this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBiomeArray()->get($x, $y, $z);
|
return $this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBiomeArray()->get($x, $y, $z);
|
||||||
@ -160,8 +161,11 @@ class Chunk{
|
|||||||
* Sets the biome ID at the specified X/Z chunk block coordinates
|
* Sets the biome ID at the specified X/Z chunk block coordinates
|
||||||
*
|
*
|
||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
|
* @param int $y dependent on the height of the world
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
* @param int $biomeId 0-255
|
* @param int $biomeId A valid biome ID
|
||||||
|
*
|
||||||
|
* @see BiomeIds
|
||||||
*/
|
*/
|
||||||
public function setBiomeId(int $x, int $y, int $z, int $biomeId) : void{
|
public function setBiomeId(int $x, int $y, int $z, int $biomeId) : void{
|
||||||
$this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBiomeArray()->set($x, $y, $z, $biomeId);
|
$this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->getBiomeArray()->set($x, $y, $z, $biomeId);
|
||||||
@ -213,7 +217,7 @@ class Chunk{
|
|||||||
* Returns the tile at the specified chunk block coordinates, or null if no tile exists.
|
* Returns the tile at the specified chunk block coordinates, or null if no tile exists.
|
||||||
*
|
*
|
||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
* @param int $y 0-255
|
* @param int $y dependent on the height of the world
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
*/
|
*/
|
||||||
public function getTile(int $x, int $y, int $z) : ?Tile{
|
public function getTile(int $x, int $y, int $z) : ?Tile{
|
||||||
@ -323,7 +327,7 @@ class Chunk{
|
|||||||
* Hashes the given chunk block coordinates into a single integer.
|
* Hashes the given chunk block coordinates into a single integer.
|
||||||
*
|
*
|
||||||
* @param int $x 0-15
|
* @param int $x 0-15
|
||||||
* @param int $y 0-255
|
* @param int $y dependent on the height of the world
|
||||||
* @param int $z 0-15
|
* @param int $z 0-15
|
||||||
*/
|
*/
|
||||||
public static function blockHash(int $x, int $y, int $z) : int{
|
public static function blockHash(int $x, int $y, int $z) : int{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user