diff --git a/src/world/sound/AnvilBreakSound.php b/src/world/sound/AnvilBreakSound.php index 9da378b35..cde91af4c 100644 --- a/src/world/sound/AnvilBreakSound.php +++ b/src/world/sound/AnvilBreakSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilBreakSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ANVIL_BREAK, 0, $pos)]; } } diff --git a/src/world/sound/AnvilFallSound.php b/src/world/sound/AnvilFallSound.php index 7abf3f6ce..3ef6cc61e 100644 --- a/src/world/sound/AnvilFallSound.php +++ b/src/world/sound/AnvilFallSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilFallSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ANVIL_FALL, 0, $pos)]; } } diff --git a/src/world/sound/AnvilUseSound.php b/src/world/sound/AnvilUseSound.php index 93c0b64ee..99beb8b0e 100644 --- a/src/world/sound/AnvilUseSound.php +++ b/src/world/sound/AnvilUseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilUseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ANVIL_USE, 0, $pos)]; } } diff --git a/src/world/sound/ArrowHitSound.php b/src/world/sound/ArrowHitSound.php index cb89dbc51..4b1d9da58 100644 --- a/src/world/sound/ArrowHitSound.php +++ b/src/world/sound/ArrowHitSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ArrowHitSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BOW_HIT, $pos, false)]; } } diff --git a/src/world/sound/BarrelCloseSound.php b/src/world/sound/BarrelCloseSound.php index 6adb76093..fa673a938 100644 --- a/src/world/sound/BarrelCloseSound.php +++ b/src/world/sound/BarrelCloseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BarrelCloseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BLOCK_BARREL_CLOSE, $pos, false)]; } } diff --git a/src/world/sound/BarrelOpenSound.php b/src/world/sound/BarrelOpenSound.php index 04edd7365..ed8a1a4df 100644 --- a/src/world/sound/BarrelOpenSound.php +++ b/src/world/sound/BarrelOpenSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BarrelOpenSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BLOCK_BARREL_OPEN, $pos, false)]; } } diff --git a/src/world/sound/BellRingSound.php b/src/world/sound/BellRingSound.php index af96e7f09..c14b63d68 100644 --- a/src/world/sound/BellRingSound.php +++ b/src/world/sound/BellRingSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; final class BellRingSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BLOCK_BELL_HIT, $pos, false)]; } } diff --git a/src/world/sound/BlazeShootSound.php b/src/world/sound/BlazeShootSound.php index 3924784d0..00f772bbe 100644 --- a/src/world/sound/BlazeShootSound.php +++ b/src/world/sound/BlazeShootSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class BlazeShootSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_BLAZE_SHOOT, 0, $pos)]; } } diff --git a/src/world/sound/BlockBreakSound.php b/src/world/sound/BlockBreakSound.php index 041664cc8..99cac4c7b 100644 --- a/src/world/sound/BlockBreakSound.php +++ b/src/world/sound/BlockBreakSound.php @@ -37,7 +37,7 @@ class BlockBreakSound implements Sound{ $this->block = $block; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BREAK, $pos, false, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()))]; } } diff --git a/src/world/sound/BlockPlaceSound.php b/src/world/sound/BlockPlaceSound.php index 0c8967469..7a95b2222 100644 --- a/src/world/sound/BlockPlaceSound.php +++ b/src/world/sound/BlockPlaceSound.php @@ -37,7 +37,7 @@ class BlockPlaceSound implements Sound{ $this->block = $block; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_PLACE, $pos, false, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()))]; } } diff --git a/src/world/sound/BlockPunchSound.php b/src/world/sound/BlockPunchSound.php index 009e1a754..51093522e 100644 --- a/src/world/sound/BlockPunchSound.php +++ b/src/world/sound/BlockPunchSound.php @@ -40,7 +40,7 @@ class BlockPunchSound implements Sound{ $this->block = $block; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound( LevelSoundEventPacket::SOUND_HIT, $pos, diff --git a/src/world/sound/BowShootSound.php b/src/world/sound/BowShootSound.php index 22b65cac6..abdb8169c 100644 --- a/src/world/sound/BowShootSound.php +++ b/src/world/sound/BowShootSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BowShootSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BOW, $pos, false)]; } } diff --git a/src/world/sound/BucketEmptyLavaSound.php b/src/world/sound/BucketEmptyLavaSound.php index d0f66e7c1..99241daf1 100644 --- a/src/world/sound/BucketEmptyLavaSound.php +++ b/src/world/sound/BucketEmptyLavaSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BucketEmptyLavaSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BUCKET_EMPTY_LAVA, $pos, false)]; } } diff --git a/src/world/sound/BucketEmptyWaterSound.php b/src/world/sound/BucketEmptyWaterSound.php index af4dec6e2..087675aa9 100644 --- a/src/world/sound/BucketEmptyWaterSound.php +++ b/src/world/sound/BucketEmptyWaterSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BucketEmptyWaterSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BUCKET_EMPTY_WATER, $pos, false)]; } } diff --git a/src/world/sound/BucketFillLavaSound.php b/src/world/sound/BucketFillLavaSound.php index 01d4edb09..d4df3ef67 100644 --- a/src/world/sound/BucketFillLavaSound.php +++ b/src/world/sound/BucketFillLavaSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BucketFillLavaSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BUCKET_FILL_LAVA, $pos, false)]; } } diff --git a/src/world/sound/BucketFillWaterSound.php b/src/world/sound/BucketFillWaterSound.php index cdb126c7c..638922413 100644 --- a/src/world/sound/BucketFillWaterSound.php +++ b/src/world/sound/BucketFillWaterSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class BucketFillWaterSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BUCKET_FILL_WATER, $pos, false)]; } } diff --git a/src/world/sound/ChestCloseSound.php b/src/world/sound/ChestCloseSound.php index 1738ed81f..2ccaaa035 100644 --- a/src/world/sound/ChestCloseSound.php +++ b/src/world/sound/ChestCloseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ChestCloseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_CHEST_CLOSED, $pos, false)]; } } diff --git a/src/world/sound/ChestOpenSound.php b/src/world/sound/ChestOpenSound.php index dd7bb6a14..ee8c9313b 100644 --- a/src/world/sound/ChestOpenSound.php +++ b/src/world/sound/ChestOpenSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ChestOpenSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_CHEST_OPEN, $pos, false)]; } } diff --git a/src/world/sound/ClickSound.php b/src/world/sound/ClickSound.php index dad9e325a..db472b292 100644 --- a/src/world/sound/ClickSound.php +++ b/src/world/sound/ClickSound.php @@ -39,7 +39,7 @@ class ClickSound implements Sound{ return $this->pitch; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_CLICK, (int) ($this->pitch * 1000), $pos)]; } } diff --git a/src/world/sound/DoorBumpSound.php b/src/world/sound/DoorBumpSound.php index 2d13b0ad8..239401637 100644 --- a/src/world/sound/DoorBumpSound.php +++ b/src/world/sound/DoorBumpSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class DoorBumpSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_DOOR_BUMP, 0, $pos)]; } } diff --git a/src/world/sound/DoorCrashSound.php b/src/world/sound/DoorCrashSound.php index fa9524a74..6f3a6cbe0 100644 --- a/src/world/sound/DoorCrashSound.php +++ b/src/world/sound/DoorCrashSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class DoorCrashSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_DOOR_CRASH, 0, $pos)]; } } diff --git a/src/world/sound/DoorSound.php b/src/world/sound/DoorSound.php index 9eca4181d..b3e4addf9 100644 --- a/src/world/sound/DoorSound.php +++ b/src/world/sound/DoorSound.php @@ -39,7 +39,7 @@ class DoorSound implements Sound{ return $this->pitch; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_DOOR, (int) ($this->pitch * 1000), $pos)]; } } diff --git a/src/world/sound/EnderChestCloseSound.php b/src/world/sound/EnderChestCloseSound.php index d016a3ae5..4292dec35 100644 --- a/src/world/sound/EnderChestCloseSound.php +++ b/src/world/sound/EnderChestCloseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class EnderChestCloseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_ENDERCHEST_CLOSED, $pos, false)]; } } diff --git a/src/world/sound/EnderChestOpenSound.php b/src/world/sound/EnderChestOpenSound.php index b2a664dd3..ab1894450 100644 --- a/src/world/sound/EnderChestOpenSound.php +++ b/src/world/sound/EnderChestOpenSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class EnderChestOpenSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_ENDERCHEST_OPEN, $pos, false)]; } } diff --git a/src/world/sound/EndermanTeleportSound.php b/src/world/sound/EndermanTeleportSound.php index 544ffcd21..e2f3f03e8 100644 --- a/src/world/sound/EndermanTeleportSound.php +++ b/src/world/sound/EndermanTeleportSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class EndermanTeleportSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ENDERMAN_TELEPORT, 0, $pos)]; } } diff --git a/src/world/sound/EntityAttackNoDamageSound.php b/src/world/sound/EntityAttackNoDamageSound.php index 0b2fb0cff..2ab77a241 100644 --- a/src/world/sound/EntityAttackNoDamageSound.php +++ b/src/world/sound/EntityAttackNoDamageSound.php @@ -31,7 +31,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; */ class EntityAttackNoDamageSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create( LevelSoundEventPacket::SOUND_ATTACK_NODAMAGE, $pos, diff --git a/src/world/sound/EntityAttackSound.php b/src/world/sound/EntityAttackSound.php index d7fd63b7b..ecf39a888 100644 --- a/src/world/sound/EntityAttackSound.php +++ b/src/world/sound/EntityAttackSound.php @@ -31,7 +31,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; */ class EntityAttackSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create( LevelSoundEventPacket::SOUND_ATTACK_STRONG, //TODO: seems like ATTACK is dysfunctional $pos, diff --git a/src/world/sound/EntityLandSound.php b/src/world/sound/EntityLandSound.php index 7871082bb..38ba283fc 100644 --- a/src/world/sound/EntityLandSound.php +++ b/src/world/sound/EntityLandSound.php @@ -44,7 +44,7 @@ class EntityLandSound implements Sound{ $this->blockLandedOn = $blockLandedOn; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create( LevelSoundEventPacket::SOUND_LAND, $pos, diff --git a/src/world/sound/EntityLongFallSound.php b/src/world/sound/EntityLongFallSound.php index 88246f846..1d0a07f40 100644 --- a/src/world/sound/EntityLongFallSound.php +++ b/src/world/sound/EntityLongFallSound.php @@ -40,7 +40,7 @@ class EntityLongFallSound implements Sound{ $this->entity = $entity; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create( LevelSoundEventPacket::SOUND_FALL_BIG, $pos, diff --git a/src/world/sound/EntityShortFallSound.php b/src/world/sound/EntityShortFallSound.php index fcacd797e..2f64cc269 100644 --- a/src/world/sound/EntityShortFallSound.php +++ b/src/world/sound/EntityShortFallSound.php @@ -39,7 +39,7 @@ class EntityShortFallSound implements Sound{ $this->entity = $entity; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create( LevelSoundEventPacket::SOUND_FALL_SMALL, $pos, diff --git a/src/world/sound/ExplodeSound.php b/src/world/sound/ExplodeSound.php index 9dfcd19f8..1f2db9c89 100644 --- a/src/world/sound/ExplodeSound.php +++ b/src/world/sound/ExplodeSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ExplodeSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_EXPLODE, $pos, false)]; } } diff --git a/src/world/sound/FireExtinguishSound.php b/src/world/sound/FireExtinguishSound.php index e9f7e3097..255e821f9 100644 --- a/src/world/sound/FireExtinguishSound.php +++ b/src/world/sound/FireExtinguishSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; final class FireExtinguishSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_EXTINGUISH_FIRE, $pos, false)]; } } diff --git a/src/world/sound/FizzSound.php b/src/world/sound/FizzSound.php index 0e7b42ffb..67be8db44 100644 --- a/src/world/sound/FizzSound.php +++ b/src/world/sound/FizzSound.php @@ -39,7 +39,7 @@ class FizzSound implements Sound{ return $this->pitch; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_FIZZ, (int) ($this->pitch * 1000), $pos)]; } } diff --git a/src/world/sound/FlintSteelSound.php b/src/world/sound/FlintSteelSound.php index 15ff96a28..4569ed510 100644 --- a/src/world/sound/FlintSteelSound.php +++ b/src/world/sound/FlintSteelSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class FlintSteelSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_IGNITE, $pos, false)]; } } diff --git a/src/world/sound/GhastShootSound.php b/src/world/sound/GhastShootSound.php index 40f6a47cc..e7cb550ff 100644 --- a/src/world/sound/GhastShootSound.php +++ b/src/world/sound/GhastShootSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class GhastShootSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_GHAST_SHOOT, 0, $pos)]; } } diff --git a/src/world/sound/GhastSound.php b/src/world/sound/GhastSound.php index b49a9c374..2e707d3db 100644 --- a/src/world/sound/GhastSound.php +++ b/src/world/sound/GhastSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class GhastSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_GHAST, 0, $pos)]; } } diff --git a/src/world/sound/IgniteSound.php b/src/world/sound/IgniteSound.php index dd72342da..1f1e88703 100644 --- a/src/world/sound/IgniteSound.php +++ b/src/world/sound/IgniteSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class IgniteSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_IGNITE, 0, $pos)]; } } diff --git a/src/world/sound/ItemBreakSound.php b/src/world/sound/ItemBreakSound.php index 0b7f07435..c2329ce12 100644 --- a/src/world/sound/ItemBreakSound.php +++ b/src/world/sound/ItemBreakSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ItemBreakSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_BREAK, $pos, false)]; } } diff --git a/src/world/sound/LaunchSound.php b/src/world/sound/LaunchSound.php index e6772f1c9..af8b02041 100644 --- a/src/world/sound/LaunchSound.php +++ b/src/world/sound/LaunchSound.php @@ -39,7 +39,7 @@ class LaunchSound implements Sound{ return $this->pitch; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_SHOOT, (int) ($this->pitch * 1000), $pos)]; } } diff --git a/src/world/sound/NoteSound.php b/src/world/sound/NoteSound.php index e84c736b0..7d2bdef42 100644 --- a/src/world/sound/NoteSound.php +++ b/src/world/sound/NoteSound.php @@ -41,7 +41,7 @@ class NoteSound implements Sound{ $this->note = $note; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_NOTE, $pos, false, ($this->instrument->getMagicNumber() << 8) | $this->note)]; } } diff --git a/src/world/sound/PaintingPlaceSound.php b/src/world/sound/PaintingPlaceSound.php index c836e0842..6d9a7ebe3 100644 --- a/src/world/sound/PaintingPlaceSound.php +++ b/src/world/sound/PaintingPlaceSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class PaintingPlaceSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ //item frame and painting have the same sound return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ITEMFRAME_PLACE, 0, $pos)]; } diff --git a/src/world/sound/PopSound.php b/src/world/sound/PopSound.php index 5bce1145f..421018333 100644 --- a/src/world/sound/PopSound.php +++ b/src/world/sound/PopSound.php @@ -39,7 +39,7 @@ class PopSound implements Sound{ return $this->pitch; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_POP, (int) ($this->pitch * 1000), $pos)]; } } diff --git a/src/world/sound/PotionSplashSound.php b/src/world/sound/PotionSplashSound.php index efde99b25..2547f2aee 100644 --- a/src/world/sound/PotionSplashSound.php +++ b/src/world/sound/PotionSplashSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class PotionSplashSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_GLASS, $pos, false)]; } } diff --git a/src/world/sound/RecordSound.php b/src/world/sound/RecordSound.php index 99e781db9..57051d5b6 100644 --- a/src/world/sound/RecordSound.php +++ b/src/world/sound/RecordSound.php @@ -36,7 +36,7 @@ class RecordSound implements Sound{ $this->recordType = $recordType; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound($this->recordType->getSoundId(), $pos, false)]; } } diff --git a/src/world/sound/RecordStopSound.php b/src/world/sound/RecordStopSound.php index 2bdd0e611..9e331a9ff 100644 --- a/src/world/sound/RecordStopSound.php +++ b/src/world/sound/RecordStopSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class RecordStopSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_STOP_RECORD, $pos, false)]; } } diff --git a/src/world/sound/RedstonePowerOffSound.php b/src/world/sound/RedstonePowerOffSound.php index 5f0ec7280..b07c723b4 100644 --- a/src/world/sound/RedstonePowerOffSound.php +++ b/src/world/sound/RedstonePowerOffSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class RedstonePowerOffSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_POWER_OFF, $pos, false)]; } } diff --git a/src/world/sound/RedstonePowerOnSound.php b/src/world/sound/RedstonePowerOnSound.php index e260d1166..d71f6b998 100644 --- a/src/world/sound/RedstonePowerOnSound.php +++ b/src/world/sound/RedstonePowerOnSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class RedstonePowerOnSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_POWER_ON, $pos, false)]; } } diff --git a/src/world/sound/ShulkerBoxCloseSound.php b/src/world/sound/ShulkerBoxCloseSound.php index 2e8e758a4..ea7a630c3 100644 --- a/src/world/sound/ShulkerBoxCloseSound.php +++ b/src/world/sound/ShulkerBoxCloseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ShulkerBoxCloseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_SHULKERBOX_CLOSED, $pos, false)]; } } diff --git a/src/world/sound/ShulkerBoxOpenSound.php b/src/world/sound/ShulkerBoxOpenSound.php index a5dacea08..491b5dace 100644 --- a/src/world/sound/ShulkerBoxOpenSound.php +++ b/src/world/sound/ShulkerBoxOpenSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ShulkerBoxOpenSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_SHULKERBOX_OPEN, $pos, false)]; } } diff --git a/src/world/sound/Sound.php b/src/world/sound/Sound.php index 84121db6a..19074e256 100644 --- a/src/world/sound/Sound.php +++ b/src/world/sound/Sound.php @@ -31,5 +31,5 @@ interface Sound{ /** * @return ClientboundPacket[] */ - public function encode(?Vector3 $pos) : array; + public function encode(Vector3 $pos) : array; } diff --git a/src/world/sound/ThrowSound.php b/src/world/sound/ThrowSound.php index 1e3297a65..b24474e5f 100644 --- a/src/world/sound/ThrowSound.php +++ b/src/world/sound/ThrowSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; class ThrowSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelSoundEventPacket::create(LevelSoundEventPacket::SOUND_THROW, $pos, -1, "minecraft:player", false, false)]; } } diff --git a/src/world/sound/TotemUseSound.php b/src/world/sound/TotemUseSound.php index baa04275c..561d9c41a 100644 --- a/src/world/sound/TotemUseSound.php +++ b/src/world/sound/TotemUseSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class TotemUseSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_TOTEM, 0, $pos)]; } } diff --git a/src/world/sound/XpCollectSound.php b/src/world/sound/XpCollectSound.php index 71a304f30..655835069 100644 --- a/src/world/sound/XpCollectSound.php +++ b/src/world/sound/XpCollectSound.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class XpCollectSound implements Sound{ - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ return [LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_ORB, 0, $pos)]; } } diff --git a/src/world/sound/XpLevelUpSound.php b/src/world/sound/XpLevelUpSound.php index aa44a5ff6..8334b7bea 100644 --- a/src/world/sound/XpLevelUpSound.php +++ b/src/world/sound/XpLevelUpSound.php @@ -41,7 +41,7 @@ class XpLevelUpSound implements Sound{ return $this->xpLevel; } - public function encode(?Vector3 $pos) : array{ + public function encode(Vector3 $pos) : array{ //No idea why such odd numbers, but this works... //TODO: check arbitrary volume return [LevelSoundEventPacket::nonActorSound(LevelSoundEventPacket::SOUND_LEVELUP, $pos, false, 0x10000000 * intdiv(min(30, $this->xpLevel), 5))];