mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
populate missing iterable value types in block namespace
This commit is contained in:
parent
259f0425a9
commit
5c8a625d88
@ -99,6 +99,10 @@ abstract class BaseRail extends Flowable{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $connections
|
||||
* @param int[][] $lookup
|
||||
*/
|
||||
protected static function searchState(array $connections, array $lookup) : int{
|
||||
$meta = array_search($connections, $lookup, true);
|
||||
if($meta === false){
|
||||
@ -114,6 +118,8 @@ abstract class BaseRail extends Flowable{
|
||||
/**
|
||||
* Returns a meta value for the rail with the given connections.
|
||||
*
|
||||
* @param int[] $connections
|
||||
*
|
||||
* @throws \InvalidArgumentException if no state matches the given connections
|
||||
*/
|
||||
protected function getMetaForState(array $connections) : int{
|
||||
@ -160,6 +166,11 @@ abstract class BaseRail extends Flowable{
|
||||
return $connections;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $constraints
|
||||
*
|
||||
* @return true[]
|
||||
*/
|
||||
private function getPossibleConnectionDirections(array $constraints) : array{
|
||||
switch(count($constraints)){
|
||||
case 0:
|
||||
@ -184,6 +195,9 @@ abstract class BaseRail extends Flowable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true[]
|
||||
*/
|
||||
protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{
|
||||
$opposite = Vector3::getOppositeSide($constraint & ~self::FLAG_ASCEND);
|
||||
|
||||
@ -243,6 +257,9 @@ abstract class BaseRail extends Flowable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $connections
|
||||
*/
|
||||
private function updateState(array $connections) : void{
|
||||
if(count($connections) === 1){
|
||||
$connections[] = Vector3::getOppositeSide($connections[0] & ~self::FLAG_ASCEND);
|
||||
|
@ -68,6 +68,9 @@ class Leaves extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param true[] $visited reference parameter
|
||||
*/
|
||||
protected function findLog(Block $pos, array &$visited, int $distance, ?int $fromSide = null) : bool{
|
||||
$index = $pos->x . "." . $pos->y . "." . $pos->z;
|
||||
if(isset($visited[$index])){
|
||||
|
Loading…
x
Reference in New Issue
Block a user