mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Merge commit '839a789180cb3acd2e16006afa9b787903ffbbcd'
This commit is contained in:
@ -631,6 +631,8 @@ abstract class Living extends Entity{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param true[] $transparent
|
||||
*
|
||||
* @return Block[]
|
||||
*/
|
||||
public function getLineOfSight(int $maxDistance, int $maxLength = 0, array $transparent = []) : array{
|
||||
@ -670,6 +672,9 @@ abstract class Living extends Entity{
|
||||
return $blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param true[] $transparent
|
||||
*/
|
||||
public function getTargetBlock(int $maxDistance, array $transparent = []) : ?Block{
|
||||
$line = $this->getLineOfSight($maxDistance, 1, $transparent);
|
||||
if(count($line) > 0){
|
||||
|
Reference in New Issue
Block a user