mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Mass removal of useless @param/@return PHPDoc annotations, pass 1
This commit is contained in:
@ -42,15 +42,11 @@ interface ChunkLoader{
|
||||
/**
|
||||
* Returns the ChunkLoader id.
|
||||
* Call Level::generateChunkLoaderId($this) to generate and save it
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLoaderId() : int;
|
||||
|
||||
/**
|
||||
* Returns if the chunk loader is currently active
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isLoaderActive() : bool;
|
||||
|
||||
@ -77,8 +73,6 @@ interface ChunkLoader{
|
||||
/**
|
||||
* This method will be called when a Chunk is replaced by a new one
|
||||
*
|
||||
* @param Chunk $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function onChunkChanged(Chunk $chunk);
|
||||
@ -86,18 +80,13 @@ interface ChunkLoader{
|
||||
/**
|
||||
* This method will be called when a registered chunk is loaded
|
||||
*
|
||||
* @param Chunk $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function onChunkLoaded(Chunk $chunk);
|
||||
|
||||
|
||||
/**
|
||||
* This method will be called when a registered chunk is unloaded
|
||||
*
|
||||
* @param Chunk $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function onChunkUnloaded(Chunk $chunk);
|
||||
@ -106,8 +95,6 @@ interface ChunkLoader{
|
||||
* This method will be called when a registered chunk is populated
|
||||
* Usually it'll be sent with another call to onChunkChanged()
|
||||
*
|
||||
* @param Chunk $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function onChunkPopulated(Chunk $chunk);
|
||||
|
@ -29,10 +29,6 @@ interface ChunkManager{
|
||||
/**
|
||||
* Gets the raw block id.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int 0-255
|
||||
*/
|
||||
public function getBlockIdAt(int $x, int $y, int $z) : int;
|
||||
@ -40,9 +36,6 @@ interface ChunkManager{
|
||||
/**
|
||||
* Sets the raw block id.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $id 0-255
|
||||
*
|
||||
* @return void
|
||||
@ -52,10 +45,6 @@ interface ChunkManager{
|
||||
/**
|
||||
* Gets the raw block metadata
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int 0-15
|
||||
*/
|
||||
public function getBlockDataAt(int $x, int $y, int $z) : int;
|
||||
@ -63,9 +52,6 @@ interface ChunkManager{
|
||||
/**
|
||||
* Sets the raw block metadata.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $data 0-15
|
||||
*
|
||||
* @return void
|
||||
@ -74,89 +60,51 @@ interface ChunkManager{
|
||||
|
||||
/**
|
||||
* Returns the raw block light level
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockLightAt(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* Sets the raw block light level
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setBlockLightAt(int $x, int $y, int $z, int $level);
|
||||
|
||||
/**
|
||||
* Returns the highest amount of sky light can reach the specified coordinates.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockSkyLightAt(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* Sets the raw block sky light level.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setBlockSkyLightAt(int $x, int $y, int $z, int $level);
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
*/
|
||||
public function getChunk(int $chunkX, int $chunkZ);
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param Chunk|null $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setChunk(int $chunkX, int $chunkZ, Chunk $chunk = null);
|
||||
|
||||
/**
|
||||
* Gets the level seed
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSeed() : int;
|
||||
|
||||
/**
|
||||
* Returns the height of the world
|
||||
* @return int
|
||||
*/
|
||||
public function getWorldHeight() : int;
|
||||
|
||||
/**
|
||||
* Returns whether the specified coordinates are within the valid world boundaries, taking world format limitations
|
||||
* into account.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isInWorld(int $x, int $y, int $z) : bool;
|
||||
}
|
||||
|
@ -67,8 +67,6 @@ class Explosion{
|
||||
private $subChunkHandler;
|
||||
|
||||
/**
|
||||
* @param Position $center
|
||||
* @param float $size
|
||||
* @param Entity|Block $what
|
||||
*/
|
||||
public function __construct(Position $center, float $size, $what = null){
|
||||
@ -90,8 +88,6 @@ class Explosion{
|
||||
/**
|
||||
* Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks
|
||||
* will be destroyed.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function explodeA() : bool{
|
||||
if($this->size < 0.1){
|
||||
@ -153,8 +149,6 @@ class Explosion{
|
||||
/**
|
||||
* Executes the explosion's effects on the world. This includes destroying blocks (if any), harming and knocking back entities,
|
||||
* and creating sounds and particles.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function explodeB() : bool{
|
||||
$send = [];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -47,12 +47,9 @@ class Location extends Position{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos
|
||||
* @param Level|null $level default null
|
||||
* @param float $yaw default 0.0
|
||||
* @param float $pitch default 0.0
|
||||
*
|
||||
* @return Location
|
||||
*/
|
||||
public static function fromObject(Vector3 $pos, Level $level = null, $yaw = 0.0, $pitch = 0.0) : Location{
|
||||
return new Location($pos->x, $pos->y, $pos->z, $yaw, $pitch, $level ?? (($pos instanceof Position) ? $pos->level : null));
|
||||
@ -60,8 +57,6 @@ class Location extends Position{
|
||||
|
||||
/**
|
||||
* Return a Location instance
|
||||
*
|
||||
* @return Location
|
||||
*/
|
||||
public function asLocation() : Location{
|
||||
return new Location($this->x, $this->y, $this->z, $this->yaw, $this->pitch, $this->level);
|
||||
|
@ -44,9 +44,6 @@ class Position extends Vector3{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos
|
||||
* @param Level|null $level
|
||||
*
|
||||
* @return Position
|
||||
*/
|
||||
public static function fromObject(Vector3 $pos, Level $level = null){
|
||||
@ -55,8 +52,6 @@ class Position extends Vector3{
|
||||
|
||||
/**
|
||||
* Return a Position instance
|
||||
*
|
||||
* @return Position
|
||||
*/
|
||||
public function asPosition() : Position{
|
||||
return new Position($this->x, $this->y, $this->z, $this->level);
|
||||
@ -80,8 +75,6 @@ class Position extends Vector3{
|
||||
/**
|
||||
* Sets the target Level of the position.
|
||||
*
|
||||
* @param Level|null $level
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException if the specified Level has been closed
|
||||
@ -97,8 +90,6 @@ class Position extends Vector3{
|
||||
|
||||
/**
|
||||
* Checks if this object has a valid reference to a loaded Level
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid() : bool{
|
||||
if($this->level !== null and $this->level->isClosed()){
|
||||
@ -113,9 +104,6 @@ class Position extends Vector3{
|
||||
/**
|
||||
* Returns a side Vector
|
||||
*
|
||||
* @param int $side
|
||||
* @param int $step
|
||||
*
|
||||
* @return Position
|
||||
*/
|
||||
public function getSide(int $side, int $step = 1){
|
||||
|
@ -39,9 +39,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
|
||||
/**
|
||||
* SimpleChunkManager constructor.
|
||||
*
|
||||
* @param int $seed
|
||||
* @param int $worldHeight
|
||||
*/
|
||||
public function __construct(int $seed, int $worldHeight = Level::Y_MAX){
|
||||
$this->seed = $seed;
|
||||
@ -51,10 +48,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
/**
|
||||
* Gets the raw block id.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int 0-255
|
||||
*/
|
||||
public function getBlockIdAt(int $x, int $y, int $z) : int{
|
||||
@ -67,9 +60,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
/**
|
||||
* Sets the raw block id.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $id 0-255
|
||||
*
|
||||
* @return void
|
||||
@ -83,10 +73,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
/**
|
||||
* Gets the raw block metadata
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int 0-15
|
||||
*/
|
||||
public function getBlockDataAt(int $x, int $y, int $z) : int{
|
||||
@ -99,9 +85,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
/**
|
||||
* Sets the raw block metadata.
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $data 0-15
|
||||
*
|
||||
* @return void
|
||||
@ -141,9 +124,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
*/
|
||||
public function getChunk(int $chunkX, int $chunkZ){
|
||||
@ -151,10 +131,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param Chunk|null $chunk
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setChunk(int $chunkX, int $chunkZ, Chunk $chunk = null){
|
||||
@ -174,8 +150,6 @@ class SimpleChunkManager implements ChunkManager{
|
||||
|
||||
/**
|
||||
* Gets the level seed
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSeed() : int{
|
||||
return $this->seed;
|
||||
|
@ -77,9 +77,6 @@ abstract class Biome{
|
||||
protected $temperature = 0.5;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param Biome $biome
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function register(int $id, Biome $biome){
|
||||
@ -110,11 +107,6 @@ abstract class Biome{
|
||||
self::register(self::BIRCH_FOREST, new ForestBiome(ForestBiome::TYPE_BIRCH));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return Biome
|
||||
*/
|
||||
public static function getBiome(int $id) : Biome{
|
||||
if(self::$biomes[$id] === null){
|
||||
self::register($id, new UnknownBiome());
|
||||
@ -130,8 +122,6 @@ abstract class Biome{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Populator $populator
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPopulator(Populator $populator){
|
||||
@ -139,11 +129,6 @@ abstract class Biome{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function populateChunk(ChunkManager $level, int $chunkX, int $chunkZ, Random $random){
|
||||
@ -160,8 +145,6 @@ abstract class Biome{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setId(int $id){
|
||||
@ -186,9 +169,6 @@ abstract class Biome{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $min
|
||||
* @param int $max
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setElevation(int $min, int $max){
|
||||
|
@ -99,12 +99,9 @@ class Chunk{
|
||||
protected $NBTentities = [];
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param SubChunkInterface[] $subChunks
|
||||
* @param CompoundTag[] $entities
|
||||
* @param CompoundTag[] $tiles
|
||||
* @param string $biomeIds
|
||||
* @param int[] $heightMap
|
||||
*/
|
||||
public function __construct(int $chunkX, int $chunkZ, array $subChunks = [], array $entities = [], array $tiles = [], string $biomeIds = "", array $heightMap = []){
|
||||
@ -139,23 +136,15 @@ class Chunk{
|
||||
$this->NBTentities = $entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getX() : int{
|
||||
return $this->x;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getZ() : int{
|
||||
return $this->z;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setX(int $x){
|
||||
@ -163,8 +152,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setZ(int $z){
|
||||
@ -173,8 +160,6 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* Returns the chunk height in count of subchunks.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHeight() : int{
|
||||
return $this->height;
|
||||
@ -201,8 +186,6 @@ class Chunk{
|
||||
* @param int $z 0-15
|
||||
* @param int|null $blockId 0-255 if null, does not change
|
||||
* @param int|null $meta 0-15 if null, does not change
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlock(int $x, int $y, int $z, ?int $blockId = null, ?int $meta = null) : bool{
|
||||
if($this->getSubChunk($y >> 4, true)->setBlock($x, $y & 0x0f, $z, $blockId !== null ? ($blockId & 0xff) : null, $meta !== null ? ($meta & 0x0f) : null)){
|
||||
@ -300,8 +283,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setAllBlockSkyLight(int $level){
|
||||
@ -342,8 +323,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setAllBlockLight(int $level){
|
||||
@ -387,8 +366,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHeightMap(int $x, int $z) : int{
|
||||
return $this->heightMap[($z << 4) | $x];
|
||||
@ -399,7 +376,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
* @param int $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -507,8 +483,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockIdColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
@ -524,8 +498,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockDataColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
@ -540,8 +512,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockSkyLightColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
@ -556,8 +526,6 @@ class Chunk{
|
||||
*
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockLightColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
@ -567,48 +535,33 @@ class Chunk{
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isLightPopulated() : bool{
|
||||
return $this->lightPopulated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setLightPopulated(bool $value = true){
|
||||
$this->lightPopulated = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPopulated() : bool{
|
||||
return $this->terrainPopulated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPopulated(bool $value = true){
|
||||
$this->terrainPopulated = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isGenerated() : bool{
|
||||
return $this->terrainGenerated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setGenerated(bool $value = true){
|
||||
@ -616,8 +569,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addEntity(Entity $entity){
|
||||
@ -631,8 +582,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeEntity(Entity $entity){
|
||||
@ -643,8 +592,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tile $tile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addTile(Tile $tile){
|
||||
@ -662,8 +609,6 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tile $tile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeTile(Tile $tile){
|
||||
@ -730,8 +675,6 @@ class Chunk{
|
||||
/**
|
||||
* Deserializes tiles and entities from NBT
|
||||
*
|
||||
* @param Level $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initChunk(Level $level){
|
||||
@ -786,9 +729,6 @@ class Chunk{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBiomeIdArray() : string{
|
||||
return $this->biomeIds;
|
||||
}
|
||||
@ -800,16 +740,11 @@ class Chunk{
|
||||
return $this->heightMap->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasChanged() : bool{
|
||||
return $this->hasChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setChanged(bool $value = true){
|
||||
@ -819,10 +754,7 @@ class Chunk{
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param int $y
|
||||
* @param bool $generateNew Whether to create a new, modifiable subchunk if there is not one in place
|
||||
*
|
||||
* @return SubChunkInterface
|
||||
*/
|
||||
public function getSubChunk(int $y, bool $generateNew = false) : SubChunkInterface{
|
||||
if($y < 0 or $y >= $this->height){
|
||||
@ -837,11 +769,7 @@ class Chunk{
|
||||
/**
|
||||
* Sets a subchunk in the chunk index
|
||||
*
|
||||
* @param int $y
|
||||
* @param SubChunkInterface|null $subChunk
|
||||
* @param bool $allowEmpty Whether to check if the chunk is empty, and if so replace it with an empty stub
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setSubChunk(int $y, SubChunkInterface $subChunk = null, bool $allowEmpty = false) : bool{
|
||||
if($y < 0 or $y >= $this->height){
|
||||
@ -865,8 +793,6 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* Returns the Y coordinate of the highest non-empty subchunk in this chunk.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHighestSubChunkIndex() : int{
|
||||
for($y = $this->subChunks->count() - 1; $y >= 0; --$y){
|
||||
@ -882,8 +808,6 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* Returns the count of subchunks that need sending to players
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSubChunkSendCount() : int{
|
||||
return $this->getHighestSubChunkIndex() + 1;
|
||||
@ -906,8 +830,6 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* Serializes the chunk for sending to players
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function networkSerialize() : string{
|
||||
$result = "";
|
||||
@ -930,8 +852,6 @@ class Chunk{
|
||||
/**
|
||||
* Fast-serializes the chunk for passing between threads
|
||||
* TODO: tiles and entities
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function fastSerialize() : string{
|
||||
$stream = new BinaryStream();
|
||||
@ -967,10 +887,6 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* Deserializes a fast-serialized chunk
|
||||
*
|
||||
* @param string $data
|
||||
*
|
||||
* @return Chunk
|
||||
*/
|
||||
public static function fastDeserialize(string $data) : Chunk{
|
||||
$stream = new BinaryStream($data);
|
||||
|
@ -25,185 +25,55 @@ namespace pocketmine\level\format;
|
||||
|
||||
interface SubChunkInterface{
|
||||
|
||||
/**
|
||||
* @param bool $checkLight
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmpty(bool $checkLight = true) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockId(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlockId(int $x, int $y, int $z, int $id) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockData(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlockData(int $x, int $y, int $z, int $data) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFullBlock(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int|null $id
|
||||
* @param int|null $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlock(int $x, int $y, int $z, ?int $id = null, ?int $data = null) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockLight(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $level
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlockLight(int $x, int $y, int $z, int $level) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockSkyLight(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $level
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHighestBlockAt(int $x, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockIdColumn(int $x, int $z) : string;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockDataColumn(int $x, int $z) : string;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockLightColumn(int $x, int $z) : string;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockSkyLightColumn(int $x, int $z) : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockIdArray() : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockDataArray() : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockSkyLightArray() : string;
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setBlockSkyLightArray(string $data);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockLightArray() : string;
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setBlockLightArray(string $data);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function networkSerialize() : string;
|
||||
}
|
||||
|
@ -143,9 +143,6 @@ abstract class BaseLevelProvider implements LevelProvider{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CompoundTag
|
||||
*/
|
||||
public function getLevelData() : CompoundTag{
|
||||
return $this->levelData;
|
||||
}
|
||||
@ -162,10 +159,6 @@ abstract class BaseLevelProvider implements LevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
* @throws CorruptedChunkException
|
||||
* @throws UnsupportedChunkFormatException
|
||||
*/
|
||||
@ -181,10 +174,6 @@ abstract class BaseLevelProvider implements LevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
* @throws UnsupportedChunkFormatException
|
||||
* @throws CorruptedChunkException
|
||||
*/
|
||||
|
@ -98,8 +98,6 @@ if(!extension_loaded('pocketmine_chunkutils')){
|
||||
* Converts pre-MCPE-1.0 biome color array to biome ID array.
|
||||
*
|
||||
* @param int[] $array of biome color values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function convertBiomeColors(array $array) : string{
|
||||
$result = str_repeat("\x00", 256);
|
||||
|
@ -30,137 +30,84 @@ use pocketmine\math\Vector3;
|
||||
|
||||
interface LevelProvider{
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
*/
|
||||
public function __construct(string $path);
|
||||
|
||||
/**
|
||||
* Returns the full provider name, like "anvil" or "mcregion", will be used to find the correct format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getProviderName() : string;
|
||||
|
||||
/**
|
||||
* Gets the build height limit of this world
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getWorldHeight() : int;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPath() : string;
|
||||
|
||||
/**
|
||||
* Tells if the path is a valid level.
|
||||
* This must tell if the current format supports opening the files in the directory
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isValid(string $path) : bool;
|
||||
|
||||
/**
|
||||
* Generate the needed files in the path given
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $name
|
||||
* @param int $seed
|
||||
* @param string $generator
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function generate(string $path, string $name, int $seed, string $generator, array $options = []);
|
||||
|
||||
/**
|
||||
* Returns the generator name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGenerator() : string;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getGeneratorOptions() : array;
|
||||
|
||||
/**
|
||||
* Saves a chunk (usually to disk).
|
||||
*
|
||||
* @param Chunk $chunk
|
||||
*/
|
||||
public function saveChunk(Chunk $chunk) : void;
|
||||
|
||||
/**
|
||||
* Loads a chunk (usually from disk storage) and returns it. If the chunk does not exist, null is returned.
|
||||
*
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return null|Chunk
|
||||
*
|
||||
* @throws CorruptedChunkException
|
||||
* @throws UnsupportedChunkFormatException
|
||||
*/
|
||||
public function loadChunk(int $chunkX, int $chunkZ) : ?Chunk;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() : string;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() : int;
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTime(int $value);
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSeed() : int;
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSeed(int $value);
|
||||
|
||||
/**
|
||||
* @return Vector3
|
||||
*/
|
||||
public function getSpawn() : Vector3;
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSpawn(Vector3 $pos);
|
||||
|
||||
/**
|
||||
* Returns the world difficulty. This will be one of the Level constants.
|
||||
* @return int
|
||||
*/
|
||||
public function getDifficulty() : int;
|
||||
|
||||
/**
|
||||
* Sets the world difficulty.
|
||||
*
|
||||
* @param int $difficulty
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDifficulty(int $difficulty);
|
||||
|
@ -42,8 +42,6 @@ abstract class LevelProviderManager{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
*
|
||||
* @return void
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -67,8 +65,6 @@ abstract class LevelProviderManager{
|
||||
/**
|
||||
* Returns a LevelProvider class for this path, or null
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getProvider(string $path){
|
||||
@ -85,8 +81,6 @@ abstract class LevelProviderManager{
|
||||
/**
|
||||
* Returns a LevelProvider by name, or null if not found
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getProviderByName(string $name){
|
||||
|
@ -297,10 +297,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
* @throws UnsupportedChunkFormatException
|
||||
*/
|
||||
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
||||
@ -521,7 +517,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
|
||||
/**
|
||||
* @param CompoundTag[] $targets
|
||||
* @param string $index
|
||||
*/
|
||||
private function writeTags(array $targets, string $index) : void{
|
||||
if(count($targets) > 0){
|
||||
@ -532,9 +527,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \LevelDB
|
||||
*/
|
||||
public function getDatabase() : \LevelDB{
|
||||
return $this->db;
|
||||
}
|
||||
|
@ -67,11 +67,6 @@ class McRegion extends BaseLevelProvider{
|
||||
/** @var RegionLoader[] */
|
||||
protected $regions = [];
|
||||
|
||||
/**
|
||||
* @param Chunk $chunk
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function nbtSerialize(Chunk $chunk) : string{
|
||||
$nbt = new CompoundTag("Level", []);
|
||||
$nbt->setInt("xPos", $chunk->getX());
|
||||
@ -127,9 +122,6 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
*
|
||||
* @return Chunk
|
||||
* @throws CorruptedChunkException
|
||||
*/
|
||||
protected function nbtDeserialize(string $data) : Chunk{
|
||||
@ -206,9 +198,6 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $context
|
||||
* @param ListTag $list
|
||||
*
|
||||
* @return CompoundTag[]
|
||||
* @throws CorruptedChunkException
|
||||
*/
|
||||
@ -236,7 +225,6 @@ class McRegion extends BaseLevelProvider{
|
||||
|
||||
/**
|
||||
* Returns the storage version as per Minecraft PC world formats.
|
||||
* @return int
|
||||
*/
|
||||
public static function getPcWorldFormatVersion() : int{
|
||||
return 19132; //mcregion
|
||||
@ -329,8 +317,6 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param int $regionX reference parameter
|
||||
* @param int $regionZ reference parameter
|
||||
*
|
||||
@ -342,9 +328,6 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $regionX
|
||||
* @param int $regionZ
|
||||
*
|
||||
* @return RegionLoader|null
|
||||
*/
|
||||
protected function getRegion(int $regionX, int $regionZ){
|
||||
@ -353,20 +336,12 @@ class McRegion extends BaseLevelProvider{
|
||||
|
||||
/**
|
||||
* Returns the path to a specific region file based on its X/Z coordinates
|
||||
*
|
||||
* @param int $regionX
|
||||
* @param int $regionZ
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function pathToRegion(int $regionX, int $regionZ) : string{
|
||||
return $this->path . "region/r.$regionX.$regionZ." . static::REGION_FILE_EXTENSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $regionX
|
||||
* @param int $regionZ
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function loadRegion(int $regionX, int $regionZ){
|
||||
@ -402,11 +377,6 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
*
|
||||
* @return Chunk|null
|
||||
*
|
||||
* @throws CorruptedChunkException
|
||||
*/
|
||||
protected function readChunk(int $chunkX, int $chunkZ) : ?Chunk{
|
||||
|
@ -122,10 +122,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return null|string
|
||||
* @throws \InvalidArgumentException if invalid coordinates are given
|
||||
* @throws CorruptedChunkException if chunk corruption is detected
|
||||
*/
|
||||
@ -174,10 +170,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return bool
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function chunkExists(int $x, int $z) : bool{
|
||||
@ -185,10 +177,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
* @param string $chunkData
|
||||
*
|
||||
* @return void
|
||||
* @throws ChunkException
|
||||
* @throws \InvalidArgumentException
|
||||
@ -219,9 +207,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return void
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -232,10 +217,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return int
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected static function getChunkOffset(int $x, int $z) : int{
|
||||
@ -246,7 +227,6 @@ class RegionLoader{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $offset
|
||||
* @param int $x reference parameter
|
||||
* @param int $z reference parameter
|
||||
*/
|
||||
@ -258,8 +238,6 @@ class RegionLoader{
|
||||
/**
|
||||
* Writes the region header and closes the file
|
||||
*
|
||||
* @param bool $writeHeader
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function close(bool $writeHeader = true){
|
||||
|
@ -35,10 +35,6 @@ class RegionLocationTableEntry{
|
||||
private $timestamp;
|
||||
|
||||
/**
|
||||
* @param int $firstSector
|
||||
* @param int $sectorCount
|
||||
* @param int $timestamp
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function __construct(int $firstSector, int $sectorCount, int $timestamp){
|
||||
@ -53,16 +49,10 @@ class RegionLocationTableEntry{
|
||||
$this->timestamp = $timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getFirstSector() : int{
|
||||
return $this->firstSector;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLastSector() : int{
|
||||
return $this->firstSector + $this->sectorCount - 1;
|
||||
}
|
||||
@ -75,23 +65,14 @@ class RegionLocationTableEntry{
|
||||
return range($this->getFirstSector(), $this->getLastSector());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSectorCount() : int{
|
||||
return $this->sectorCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTimestamp() : int{
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isNull() : bool{
|
||||
return $this->firstSector === 0 or $this->sectorCount === 0;
|
||||
}
|
||||
|
@ -64,8 +64,6 @@ class Flat extends Generator{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
public function __construct(array $options = []){
|
||||
@ -96,8 +94,6 @@ class Flat extends Generator{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $layers
|
||||
*
|
||||
* @return int[][]
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
|
@ -36,10 +36,6 @@ abstract class Generator{
|
||||
|
||||
/**
|
||||
* Converts a string level seed into an integer for use by the generator.
|
||||
*
|
||||
* @param string $seed
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public static function convertSeed(string $seed) : ?int{
|
||||
if($seed === ""){ //empty seed should cause a random seed to be selected - can't use 0 here because 0 is a valid seed
|
||||
@ -59,8 +55,6 @@ abstract class Generator{
|
||||
protected $random;
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
abstract public function __construct(array $settings = []);
|
||||
|
@ -73,7 +73,6 @@ final class GeneratorManager{
|
||||
/**
|
||||
* Returns a class name of a registered Generator matching the given name.
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $throwOnMissing @deprecated this is for backwards compatibility only
|
||||
*
|
||||
* @return string|Generator Name of class that extends Generator (not an actual Generator object)
|
||||
@ -94,8 +93,6 @@ final class GeneratorManager{
|
||||
* Returns the registered name of the given Generator class.
|
||||
*
|
||||
* @param string $class Fully qualified name of class that extends \pocketmine\level\generator\Generator
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getGeneratorName(string $class) : string{
|
||||
foreach(self::$list as $name => $c){
|
||||
|
@ -45,9 +45,6 @@ abstract class BiomeSelector{
|
||||
/**
|
||||
* Lookup function called by recalculate() to determine the biome to use for this temperature and rainfall.
|
||||
*
|
||||
* @param float $temperature
|
||||
* @param float $rainfall
|
||||
*
|
||||
* @return int biome ID 0-255
|
||||
*/
|
||||
abstract protected function lookup(float $temperature, float $rainfall) : int;
|
||||
@ -92,8 +89,6 @@ abstract class BiomeSelector{
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return Biome
|
||||
*/
|
||||
public function pickBiome($x, $z) : Biome{
|
||||
$temperature = (int) ($this->getTemperature($x, $z) * 63);
|
||||
|
@ -53,8 +53,6 @@ class Nether extends Generator{
|
||||
private $noiseBase;
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
public function __construct(array $options = []){
|
||||
|
@ -48,8 +48,6 @@ abstract class Noise{
|
||||
|
||||
/**
|
||||
* @param float $x
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function floor($x) : int{
|
||||
return $x >= 0 ? (int) $x : (int) ($x - 1);
|
||||
@ -250,16 +248,6 @@ abstract class Noise{
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $xSize
|
||||
* @param int $samplingRate
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return \SplFixedArray
|
||||
*/
|
||||
public function getFastNoise1D(int $xSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||
if($samplingRate === 0){
|
||||
throw new \InvalidArgumentException("samplingRate cannot be 0");
|
||||
@ -284,16 +272,6 @@ abstract class Noise{
|
||||
return $noiseArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $xSize
|
||||
* @param int $zSize
|
||||
* @param int $samplingRate
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return \SplFixedArray
|
||||
*/
|
||||
public function getFastNoise2D(int $xSize, int $zSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||
assert($samplingRate !== 0, new \InvalidArgumentException("samplingRate cannot be 0"));
|
||||
|
||||
@ -330,19 +308,6 @@ abstract class Noise{
|
||||
return $noiseArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $xSize
|
||||
* @param int $ySize
|
||||
* @param int $zSize
|
||||
* @param int $xSamplingRate
|
||||
* @param int $ySamplingRate
|
||||
* @param int $zSamplingRate
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFastNoise3D(int $xSize, int $ySize, int $zSize, int $xSamplingRate, int $ySamplingRate, int $zSamplingRate, int $x, int $y, int $z) : array{
|
||||
|
||||
assert($xSamplingRate !== 0, new \InvalidArgumentException("xSamplingRate cannot be 0"));
|
||||
|
@ -35,7 +35,6 @@ class Perlin extends Noise{
|
||||
|
||||
|
||||
/**
|
||||
* @param Random $random
|
||||
* @param int $octaves
|
||||
* @param float $persistence
|
||||
* @param float $expansion
|
||||
|
@ -84,7 +84,6 @@ class Simplex extends Perlin{
|
||||
|
||||
|
||||
/**
|
||||
* @param Random $random
|
||||
* @param int $octaves
|
||||
* @param float $persistence
|
||||
* @param float $expansion
|
||||
|
@ -61,8 +61,6 @@ class Normal extends Generator{
|
||||
private static $SMOOTH_SIZE = 2;
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
public function __construct(array $options = []){
|
||||
|
@ -36,12 +36,6 @@ class BigTree extends Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||
|
@ -41,12 +41,6 @@ class BirchTree extends Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||
|
@ -37,12 +37,6 @@ class OakTree extends Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||
|
@ -50,11 +50,6 @@ class Ore{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z){
|
||||
|
@ -44,9 +44,6 @@ class Pond{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param Vector3 $pos
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, Vector3 $pos){
|
||||
|
@ -40,12 +40,6 @@ class SpruceTree extends Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||
|
@ -32,12 +32,6 @@ use function count;
|
||||
class TallGrass{
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param Vector3 $pos
|
||||
* @param Random $random
|
||||
* @param int $count
|
||||
* @param int $radius
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function growGrass(ChunkManager $level, Vector3 $pos, Random $random, int $count = 15, int $radius = 10){
|
||||
|
@ -50,13 +50,6 @@ abstract class Tree{
|
||||
public $treeHeight = 7;
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
* @param int $type
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function growTree(ChunkManager $level, int $x, int $y, int $z, Random $random, int $type = 0){
|
||||
@ -111,12 +104,6 @@ abstract class Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||
@ -143,13 +130,6 @@ abstract class Tree{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param Random $random
|
||||
* @param int $trunkHeight
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function placeTrunk(ChunkManager $level, int $x, int $y, int $z, Random $random, int $trunkHeight){
|
||||
|
@ -50,8 +50,6 @@ class Pond extends Populator{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $waterOdd
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setWaterOdd(int $waterOdd){
|
||||
@ -59,8 +57,6 @@ class Pond extends Populator{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $lavaOdd
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setLavaOdd(int $lavaOdd){
|
||||
@ -68,8 +64,6 @@ class Pond extends Populator{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $lavaSurfaceOdd
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setLavaSurfaceOdd(int $lavaSurfaceOdd){
|
||||
|
@ -32,11 +32,6 @@ use pocketmine\utils\Random;
|
||||
abstract class Populator{
|
||||
|
||||
/**
|
||||
* @param ChunkManager $level
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param Random $random
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function populate(ChunkManager $level, int $chunkX, int $chunkZ, Random $random);
|
||||
|
@ -60,21 +60,11 @@ abstract class LightUpdate{
|
||||
abstract protected function getLight(int $x, int $y, int $z) : int;
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
abstract protected function setLight(int $x, int $y, int $z, int $level);
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $newLevel
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setAndUpdateLight(int $x, int $y, int $z, int $newLevel){
|
||||
@ -157,11 +147,6 @@ abstract class LightUpdate{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $oldAdjacentLevel
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function computeRemoveLight(int $x, int $y, int $z, int $oldAdjacentLevel){
|
||||
@ -185,11 +170,6 @@ abstract class LightUpdate{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
* @param int $newAdjacentLevel
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function computeSpreadLight(int $x, int $y, int $z, int $newAdjacentLevel){
|
||||
|
@ -48,11 +48,6 @@ class FloatingTextParticle extends Particle{
|
||||
/** @var bool */
|
||||
protected $invisible = false;
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos
|
||||
* @param string $text
|
||||
* @param string $title
|
||||
*/
|
||||
public function __construct(Vector3 $pos, string $text, string $title = ""){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->text = $text;
|
||||
|
Reference in New Issue
Block a user