Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2021-12-08 19:40:25 +00:00
commit 5b868e6d5e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 12 additions and 8 deletions

View File

@ -39,7 +39,7 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
/** @var Item */
private $bow;
/** @var Projectile */
/** @var Entity */
private $projectile;
/** @var float */
private $force;

View File

@ -2373,6 +2373,9 @@ class World implements ChunkManager{
if(!$pos->isValid() || $pos->getWorld() !== $this){
throw new \InvalidArgumentException("Invalid Tile world");
}
if(!$this->isInWorld($pos->getFloorX(), $pos->getFloorY(), $pos->getFloorZ())){
throw new \InvalidArgumentException("Tile position is outside the world bounds");
}
$chunkX = $pos->getFloorX() >> Chunk::COORD_BIT_SIZE;
$chunkZ = $pos->getFloorZ() >> Chunk::COORD_BIT_SIZE;
@ -2528,9 +2531,15 @@ class World implements ChunkManager{
}
if($tile === null){
$logger->warning("Deleted unknown tile entity type " . $nbt->getString("id", "<unknown>"));
}elseif(!$this->isChunkLoaded($tile->getPosition()->getFloorX() >> Chunk::COORD_BIT_SIZE, $tile->getPosition()->getFloorZ() >> Chunk::COORD_BIT_SIZE)){
continue;
}
$tilePosition = $tile->getPosition();
if(!$this->isChunkLoaded($tilePosition->getFloorX() >> Chunk::COORD_BIT_SIZE, $tilePosition->getFloorZ() >> Chunk::COORD_BIT_SIZE)){
$logger->error("Found tile saved on wrong chunk - unable to fix due to correct chunk not loaded");
}elseif($this->getTile($tilePosition = $tile->getPosition()) !== null){
}elseif(!$this->isInWorld($tilePosition->getFloorX(), $tilePosition->getFloorY(), $tilePosition->getFloorZ())){
$logger->error("Cannot add tile with position outside the world bounds: x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z");
}elseif($this->getTile($tilePosition) !== null){
$logger->error("Cannot add tile at x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z: Another tile is already at that position");
}else{
$this->addTile($tile);

View File

@ -545,11 +545,6 @@ parameters:
count: 1
path: ../../../src/entity/projectile/Projectile.php
-
message: "#^Property pocketmine\\\\event\\\\entity\\\\EntityShootBowEvent\\:\\:\\$projectile \\(pocketmine\\\\entity\\\\projectile\\\\Projectile\\) does not accept pocketmine\\\\entity\\\\Entity\\.$#"
count: 1
path: ../../../src/event/entity/EntityShootBowEvent.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1