mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
commit
5b868e6d5e
@ -39,7 +39,7 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
|||||||
|
|
||||||
/** @var Item */
|
/** @var Item */
|
||||||
private $bow;
|
private $bow;
|
||||||
/** @var Projectile */
|
/** @var Entity */
|
||||||
private $projectile;
|
private $projectile;
|
||||||
/** @var float */
|
/** @var float */
|
||||||
private $force;
|
private $force;
|
||||||
|
@ -2373,6 +2373,9 @@ class World implements ChunkManager{
|
|||||||
if(!$pos->isValid() || $pos->getWorld() !== $this){
|
if(!$pos->isValid() || $pos->getWorld() !== $this){
|
||||||
throw new \InvalidArgumentException("Invalid Tile world");
|
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;
|
$chunkX = $pos->getFloorX() >> Chunk::COORD_BIT_SIZE;
|
||||||
$chunkZ = $pos->getFloorZ() >> Chunk::COORD_BIT_SIZE;
|
$chunkZ = $pos->getFloorZ() >> Chunk::COORD_BIT_SIZE;
|
||||||
@ -2528,9 +2531,15 @@ class World implements ChunkManager{
|
|||||||
}
|
}
|
||||||
if($tile === null){
|
if($tile === null){
|
||||||
$logger->warning("Deleted unknown tile entity type " . $nbt->getString("id", "<unknown>"));
|
$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");
|
$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");
|
$logger->error("Cannot add tile at x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z: Another tile is already at that position");
|
||||||
}else{
|
}else{
|
||||||
$this->addTile($tile);
|
$this->addTile($tile);
|
||||||
|
@ -545,11 +545,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/entity/projectile/Projectile.php
|
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\\.$#"
|
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user