mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Fixed a bunch of things PHPStan finds unpalatable
close #2614, fix a bunch of docs bugs, fix sendCreativeContents() crash on Human holders, move some inline variable declarations
This commit is contained in:
@ -686,7 +686,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
public function unregisterChunkLoader(ChunkLoader $loader, int $chunkX, int $chunkZ){
|
||||
if(isset($this->chunkLoaders[$index = Level::chunkHash($chunkX, $chunkZ)][$hash = $loader->getLoaderId()])){
|
||||
$index = Level::chunkHash($chunkX, $chunkZ);
|
||||
$hash = $loader->getLoaderId();
|
||||
if(isset($this->chunkLoaders[$index][$hash])){
|
||||
unset($this->chunkLoaders[$index][$hash]);
|
||||
unset($this->playerLoaders[$index][$hash]);
|
||||
if(count($this->chunkLoaders[$index]) === 0){
|
||||
@ -1346,9 +1348,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $x
|
||||
* @param $y
|
||||
* @param $z
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $z
|
||||
*
|
||||
* @return int bitmap, (id << 4) | data
|
||||
*/
|
||||
@ -2079,7 +2081,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $tileId
|
||||
* @param int $tileId
|
||||
*
|
||||
* @return Tile|null
|
||||
*/
|
||||
@ -2185,7 +2187,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(!$this->isInWorld($x, $y, $z)){ //TODO: bad hack but fixing this requires BC breaks to do properly :(
|
||||
return;
|
||||
}
|
||||
unset($this->blockCache[$chunkHash = Level::chunkHash($x >> 4, $z >> 4)][$blockHash = Level::blockHash($x, $y, $z)]);
|
||||
$chunkHash = Level::chunkHash($x >> 4, $z >> 4);
|
||||
$blockHash = Level::blockHash($x, $y, $z);
|
||||
unset($this->blockCache[$chunkHash][$blockHash]);
|
||||
$this->getChunk($x >> 4, $z >> 4, true)->setBlockId($x & 0x0f, $y, $z & 0x0f, $id & 0xff);
|
||||
|
||||
if(!isset($this->changedBlocks[$chunkHash])){
|
||||
@ -2222,7 +2226,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(!$this->isInWorld($x, $y, $z)){ //TODO: bad hack but fixing this requires BC breaks to do properly :(
|
||||
return;
|
||||
}
|
||||
unset($this->blockCache[$chunkHash = Level::chunkHash($x >> 4, $z >> 4)][$blockHash = Level::blockHash($x, $y, $z)]);
|
||||
$chunkHash = Level::chunkHash($x >> 4, $z >> 4);
|
||||
$blockHash = Level::blockHash($x, $y, $z);
|
||||
unset($this->blockCache[$chunkHash][$blockHash]);
|
||||
|
||||
$this->getChunk($x >> 4, $z >> 4, true)->setBlockData($x & 0x0f, $y, $z & 0x0f, $data & 0x0f);
|
||||
|
||||
|
@ -118,7 +118,7 @@ interface LevelProvider{
|
||||
public function getTime() : int;
|
||||
|
||||
/**
|
||||
* @param int
|
||||
* @param int $value
|
||||
*/
|
||||
public function setTime(int $value);
|
||||
|
||||
@ -128,7 +128,7 @@ interface LevelProvider{
|
||||
public function getSeed() : int;
|
||||
|
||||
/**
|
||||
* @param int
|
||||
* @param int $value
|
||||
*/
|
||||
public function setSeed(int $value);
|
||||
|
||||
|
@ -75,8 +75,9 @@ abstract class BiomeSelector{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $x
|
||||
* @param $z
|
||||
* TODO: not sure on types here
|
||||
* @param int|float $x
|
||||
* @param int|float $z
|
||||
*
|
||||
* @return Biome
|
||||
*/
|
||||
|
Reference in New Issue
Block a user