mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Sound::encode() position is no longer nullable
making this nullable was based on the invalid assumption that global sounds have no position, but it turns out they _do_ still use the position to make the sound come from the correct direction.
This commit is contained in:
parent
e50072dc27
commit
701a71a4ee
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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()))];
|
||||
}
|
||||
}
|
||||
|
@ -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()))];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -31,5 +31,5 @@ interface Sound{
|
||||
/**
|
||||
* @return ClientboundPacket[]
|
||||
*/
|
||||
public function encode(?Vector3 $pos) : array;
|
||||
public function encode(Vector3 $pos) : array;
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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)];
|
||||
}
|
||||
}
|
||||
|
@ -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))];
|
||||
|
Loading…
x
Reference in New Issue
Block a user