mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
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:
@ -64,7 +64,7 @@ class Bow extends Tool{
|
||||
$p = $diff / 20;
|
||||
$baseForce = min((($p ** 2) + $p * 2) / 3, 1);
|
||||
|
||||
$entity = Entity::createEntity("Arrow", $player->getLevel(), $nbt, $player, $baseForce >= 1);
|
||||
$entity = Entity::createEntity("Arrow", $player->getLevelNonNull(), $nbt, $player, $baseForce >= 1);
|
||||
if($entity instanceof Projectile){
|
||||
$infinity = $this->hasEnchantment(Enchantment::INFINITY);
|
||||
if($entity instanceof ArrowEntity){
|
||||
@ -110,7 +110,7 @@ class Bow extends Tool{
|
||||
$ev->getProjectile()->flagForDespawn();
|
||||
}else{
|
||||
$ev->getProjectile()->spawnToAll();
|
||||
$player->getLevel()->broadcastLevelSoundEvent($player, LevelSoundEventPacket::SOUND_BOW);
|
||||
$player->getLevelNonNull()->broadcastLevelSoundEvent($player, LevelSoundEventPacket::SOUND_BOW);
|
||||
}
|
||||
}else{
|
||||
$entity->spawnToAll();
|
||||
|
Reference in New Issue
Block a user