Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor
2022-11-04 20:47:26 +00:00
18 changed files with 54 additions and 13 deletions

View File

@@ -395,6 +395,9 @@ class World implements ChunkManager{
/**
* @phpstan-param BlockPosHash $hash
* @phpstan-param-out int $x
* @phpstan-param-out int $y
* @phpstan-param-out int $z
*/
public static function getBlockXYZ(int $hash, ?int &$x, ?int &$y, ?int &$z) : void{
[$baseX, $baseY, $baseZ] = morton3d_decode($hash);
@@ -409,6 +412,8 @@ class World implements ChunkManager{
/**
* @phpstan-param ChunkPosHash $hash
* @phpstan-param-out int $x
* @phpstan-param-out int $z
*/
public static function getXZ(int $hash, ?int &$x, ?int &$z) : void{
[$x, $z] = morton2d_decode($hash);
@@ -1792,6 +1797,7 @@ class World implements ChunkManager{
*
* @param Item &$item reference parameter (if null, can break anything)
* @param Item[] &$returnedItems Items to be added to the target's inventory (or dropped, if the inventory is full)
* @phpstan-param-out Item $item
*/
public function useBreakOn(Vector3 $vector, Item &$item = null, ?Player $player = null, bool $createParticles = false, array &$returnedItems = []) : bool{
$vector = $vector->floor();

View File

@@ -188,6 +188,11 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
return PalettedBlockArray::fromData($bitsPerBlock, $words, $palette);
}
/**
* @phpstan-param-out int $x
* @phpstan-param-out int $y
* @phpstan-param-out int $z
*/
protected static function deserializeExtraDataKey(int $chunkVersion, int $key, ?int &$x, ?int &$y, ?int &$z) : void{
if($chunkVersion >= ChunkVersion::v1_0_0){
$x = ($key >> 12) & 0xf;

View File

@@ -269,6 +269,8 @@ class RegionLoader{
/**
* @param int $x reference parameter
* @param int $z reference parameter
* @phpstan-param-out int $x
* @phpstan-param-out int $z
*/
protected static function getChunkCoords(int $offset, ?int &$x, ?int &$z) : void{
$x = $offset & 0x1f;

View File

@@ -92,6 +92,8 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
/**
* @param int $regionX reference parameter
* @param int $regionZ reference parameter
* @phpstan-param-out int $regionX
* @phpstan-param-out int $regionZ
*/
public static function getRegionIndex(int $chunkX, int $chunkZ, &$regionX, &$regionZ) : void{
$regionX = $chunkX >> 5;