mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Nix some client-sided sounds, control them from the server
this is a necessary step to knock out the implicit assumption that every player is using the same protocol.
This commit is contained in:
@@ -754,6 +754,14 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
|
||||
//TODO: we want to block out this packet completely, but we don't yet know the full scope of sounds that the client sends us from here
|
||||
switch($packet->sound){
|
||||
case LevelSoundEventPacket::SOUND_LAND:
|
||||
case LevelSoundEventPacket::SOUND_FALL:
|
||||
case LevelSoundEventPacket::SOUND_FALL_SMALL:
|
||||
case LevelSoundEventPacket::SOUND_FALL_BIG:
|
||||
return true;
|
||||
}
|
||||
$this->player->getWorld()->broadcastPacketToViewers($this->player->getPosition(), $packet);
|
||||
return true;
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@ class AddActorPacket extends DataPacket implements ClientboundPacket{
|
||||
* TODO: remove this on 4.0
|
||||
*/
|
||||
public const LEGACY_ID_MAP_BC = [
|
||||
-1 => ":",
|
||||
EntityLegacyIds::NPC => "minecraft:npc",
|
||||
EntityLegacyIds::PLAYER => "minecraft:player",
|
||||
EntityLegacyIds::WITHER_SKELETON => "minecraft:wither_skeleton",
|
||||
|
Reference in New Issue
Block a user