Merge commit '8726604899d1a371567141e0831ed570d3233356'

This commit is contained in:
Dylan K. Taylor
2019-12-25 14:19:35 +00:00
16 changed files with 39 additions and 30 deletions

View File

@@ -717,7 +717,7 @@ abstract class Living extends Entity{
*/
public function getTargetBlock(int $maxDistance, array $transparent = []) : ?Block{
$line = $this->getLineOfSight($maxDistance, 1, $transparent);
if(!empty($line)){
if(count($line) > 0){
return array_shift($line);
}

View File

@@ -39,6 +39,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\utils\Color;
use pocketmine\world\particle\PotionSplashParticle;
use pocketmine\world\sound\PotionSplashSound;
use function count;
use function round;
use function sqrt;
@@ -75,7 +76,7 @@ class SplashPotion extends Throwable{
$effects = $this->getPotionEffects();
$hasEffects = true;
if(empty($effects)){
if(count($effects) === 0){
$particle = new PotionSplashParticle(PotionSplashParticle::DEFAULT_COLOR());
$hasEffects = false;
}else{