Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-12-23 16:56:54 +00:00
commit 17125ce0e3
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
5 changed files with 19 additions and 7 deletions

View File

@ -199,6 +199,8 @@ jobs:
with: with:
php-version: 8.0 php-version: 8.0
tools: php-cs-fixer:3.11 tools: php-cs-fixer:3.11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run PHP-CS-Fixer - name: Run PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --diff --ansi run: php-cs-fixer fix --dry-run --diff --ansi

12
composer.lock generated
View File

@ -1880,16 +1880,16 @@
}, },
{ {
"name": "phpstan/phpstan-phpunit", "name": "phpstan/phpstan-phpunit",
"version": "1.3.2", "version": "1.3.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git", "url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088" "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/54a24bd23e9e80ee918cdc24f909d376c2e273f7",
"reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1926,9 +1926,9 @@
"description": "PHPUnit extensions and rules for PHPStan", "description": "PHPUnit extensions and rules for PHPStan",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues", "issues": "https://github.com/phpstan/phpstan-phpunit/issues",
"source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.2" "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.3"
}, },
"time": "2022-12-13T15:08:22+00:00" "time": "2022-12-21T15:25:00+00:00"
}, },
{ {
"name": "phpstan/phpstan-strict-rules", "name": "phpstan/phpstan-strict-rules",

View File

@ -72,6 +72,11 @@ class GamemodeCommand extends VanillaCommand{
throw new InvalidCommandSyntaxException(); throw new InvalidCommandSyntaxException();
} }
if($target->getGamemode()->equals($gameMode)){
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_gamemode_failure($target->getName()));
return true;
}
$target->setGamemode($gameMode); $target->setGamemode($gameMode);
if(!$gameMode->equals($target->getGamemode())){ if(!$gameMode->equals($target->getGamemode())){
$sender->sendMessage(KnownTranslationFactory::pocketmine_command_gamemode_failure($target->getName())); $sender->sendMessage(KnownTranslationFactory::pocketmine_command_gamemode_failure($target->getName()));

View File

@ -31,6 +31,10 @@ class HandlerList{
/** @var RegisteredListener[][] */ /** @var RegisteredListener[][] */
private array $handlerSlots = []; private array $handlerSlots = [];
/**
* @phpstan-template TEvent of Event
* @phpstan-param class-string<TEvent> $class
*/
public function __construct( public function __construct(
private string $class, private string $class,
private ?HandlerList $parentList private ?HandlerList $parentList

View File

@ -1264,7 +1264,8 @@ class World implements ChunkManager{
private function tickChunk(int $chunkX, int $chunkZ) : void{ private function tickChunk(int $chunkX, int $chunkZ) : void{
$chunk = $this->getChunk($chunkX, $chunkZ); $chunk = $this->getChunk($chunkX, $chunkZ);
if($chunk === null){ if($chunk === null){
throw new \InvalidArgumentException("Chunk is not loaded"); //the chunk may have been unloaded during a previous chunk's update (e.g. during BlockGrowEvent)
return;
} }
foreach($this->getChunkEntities($chunkX, $chunkZ) as $entity){ foreach($this->getChunkEntities($chunkX, $chunkZ) as $entity){
$entity->onRandomUpdate(); $entity->onRandomUpdate();