Merge branch 'next-major' into modern-world-support

This commit is contained in:
Dylan K. Taylor
2022-06-02 20:24:25 +01:00
26 changed files with 299 additions and 351 deletions

View File

@@ -28,16 +28,9 @@ use pocketmine\utils\AssumptionFailedError;
use function assert;
class Position extends Vector3{
public ?World $world = null;
/** @var World|null */
public $world = null;
/**
* @param float|int $x
* @param float|int $y
* @param float|int $z
*/
public function __construct($x, $y, $z, ?World $world){
public function __construct(float|int $x, float|int $y, float|int $z, ?World $world){
parent::__construct($x, $y, $z);
if($world !== null && !$world->isLoaded()){
throw new \InvalidArgumentException("Specified world has been unloaded and cannot be used");

View File

@@ -1904,11 +1904,9 @@ class World implements ChunkManager{
public function getCollidingEntities(AxisAlignedBB $bb, ?Entity $entity = null) : array{
$nearby = [];
if($entity === null || $entity->canCollide){
foreach($this->getNearbyEntities($bb, $entity) as $ent){
if($ent->canBeCollidedWith() && ($entity === null || $entity->canCollideWith($ent))){
$nearby[] = $ent;
}
foreach($this->getNearbyEntities($bb, $entity) as $ent){
if($ent->canBeCollidedWith() && ($entity === null || $entity->canCollideWith($ent))){
$nearby[] = $ent;
}
}

View File

@@ -64,9 +64,6 @@ class RegionLoader{
public const FIRST_SECTOR = 2; //location table occupies 0 and 1
/** @var int */
public static $COMPRESSION_LEVEL = 7;
/** @var string */
protected $filePath;
/** @var resource */