Fixed a bunch of missed Position->getLevel() usages

these were not in the usage search because PhpStorm decided to refer to ChunkLoader->getLevel() for any Player references, which caused them to only show when that was searched.

There's also an undetected LSP violation with ChunkLoader because it requires returning Level and Position->getLevel() returns Level|null. I don't know why PHPStan doesn't complain about that.
This commit is contained in:
Dylan K. Taylor
2020-05-19 21:01:18 +01:00
parent dc9351b024
commit da4a2d8552
13 changed files with 19 additions and 71 deletions

View File

@ -597,7 +597,7 @@ parameters:
-
message: "#^Cannot call method getSeed\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 2
count: 1
path: ../../../src/pocketmine/command/defaults/SeedCommand.php
-
@ -605,11 +605,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/command/defaults/SetWorldSpawnCommand.php
-
message: "#^Cannot call method getSpawnLocation\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/SpawnpointCommand.php
-
message: "#^Parameter \\#1 \\$name of method pocketmine\\\\Server\\:\\:getPlayer\\(\\) expects string, string\\|null given\\.$#"
count: 1
@ -845,11 +840,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/entity/Living.php
-
message: "#^Cannot call method getDifficulty\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/entity/Living.php
-
message: "#^Cannot call method dropExperience\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
@ -1030,31 +1020,11 @@ parameters:
count: 1
path: ../../../src/pocketmine/item/Banner.php
-
message: "#^Parameter \\#2 \\$level of static method pocketmine\\\\entity\\\\Entity\\:\\:createEntity\\(\\) expects pocketmine\\\\level\\\\Level, pocketmine\\\\level\\\\Level\\|null given\\.$#"
count: 1
path: ../../../src/pocketmine/item/Bow.php
-
message: "#^Cannot call method broadcastLevelSoundEvent\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/item/Bow.php
-
message: "#^Cannot call method spawnToAll\\(\\) on pocketmine\\\\entity\\\\Entity\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/item/Bow.php
-
message: "#^Cannot call method setBlock\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 2
path: ../../../src/pocketmine/item/Bucket.php
-
message: "#^Cannot call method broadcastLevelSoundEvent\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 2
path: ../../../src/pocketmine/item/Bucket.php
-
message: "#^Parameter \\#1 \\$effectType of class pocketmine\\\\entity\\\\EffectInstance constructor expects pocketmine\\\\entity\\\\Effect, pocketmine\\\\entity\\\\Effect\\|null given\\.$#"
count: 2
@ -1075,11 +1045,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/item/PaintingItem.php
-
message: "#^Cannot call method broadcastLevelEvent\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/item/PaintingItem.php
-
message: "#^Parameter \\#1 \\$effectType of class pocketmine\\\\entity\\\\EffectInstance constructor expects pocketmine\\\\entity\\\\Effect, pocketmine\\\\entity\\\\Effect\\|null given\\.$#"
count: 1
@ -1090,16 +1055,6 @@ parameters:
count: 32
path: ../../../src/pocketmine/item/Potion.php
-
message: "#^Parameter \\#2 \\$level of static method pocketmine\\\\entity\\\\Entity\\:\\:createEntity\\(\\) expects pocketmine\\\\level\\\\Level, pocketmine\\\\level\\\\Level\\|null given\\.$#"
count: 1
path: ../../../src/pocketmine/item/ProjectileItem.php
-
message: "#^Cannot call method broadcastLevelSoundEvent\\(\\) on pocketmine\\\\level\\\\Level\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/item/ProjectileItem.php
-
message: "#^Parameter \\#1 \\$effectType of class pocketmine\\\\entity\\\\EffectInstance constructor expects pocketmine\\\\entity\\\\Effect, pocketmine\\\\entity\\\\Effect\\|null given\\.$#"
count: 3
@ -1115,11 +1070,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/item/RottenFlesh.php
-
message: "#^Parameter \\#2 \\$level of static method pocketmine\\\\entity\\\\Entity\\:\\:createEntity\\(\\) expects pocketmine\\\\level\\\\Level, pocketmine\\\\level\\\\Level\\|null given\\.$#"
count: 1
path: ../../../src/pocketmine/item/SpawnEgg.php
-
message: "#^Parameter \\#1 \\$effectType of class pocketmine\\\\entity\\\\EffectInstance constructor expects pocketmine\\\\entity\\\\Effect, pocketmine\\\\entity\\\\Effect\\|null given\\.$#"
count: 1