Silence LevelSoundEventPacket noise

This commit is contained in:
Dylan K. Taylor 2021-04-19 01:02:22 +01:00
parent 4f4069d403
commit 6845cbb2b3
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 12 additions and 1 deletions

View File

@ -62,6 +62,7 @@ use pocketmine\network\mcpe\protocol\InteractPacket;
use pocketmine\network\mcpe\protocol\InventoryTransactionPacket;
use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket;
use pocketmine\network\mcpe\protocol\LabTablePacket;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacketV1;
use pocketmine\network\mcpe\protocol\MapInfoRequestPacket;
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
@ -851,4 +852,14 @@ class InGamePacketHandler extends PacketHandler{
public function handleNetworkStackLatency(NetworkStackLatencyPacket $packet) : bool{
return true; //TODO: implement this properly - this is here to silence debug spam from MCPE dev builds
}
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
/*
* We don't handle this - all sounds are handled by the server now.
* However, some plugins find this useful to detect events like left-click-air, which doesn't have any other
* action bound to it.
* In addition, we use this handler to silence debug noise, since this packet is frequently sent by the client.
*/
return true;
}
}

View File

@ -28,7 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, GarbageServerboundPacket{
class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET;
public const SOUND_ITEM_USE_ON = 0;