From bc9ebac4d55f28ec6cd94fb9a80e8f6ca87968e8 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 11 Nov 2021 23:08:44 +1300 Subject: [PATCH] Accidentally removed a cancel, don't bother sending our sound packets if we're not modifying the sound groups --- .../packets/packetlisteners/PacketListenerSounds.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java index 3f96d20b..9162184d 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java @@ -217,21 +217,21 @@ public class PacketListenerSounds extends PacketAdapter { } } - SoundGroup disSound = SoundGroup.getGroup(entity.getType().name()); + SoundGroup entitySoundGroup = SoundGroup.getGroup(entity.getType().name()); - if (disSound == null) { + if (entitySoundGroup == null) { return; } - Object sound = disSound.getSound(soundType); + Object sound = entitySoundGroup.getSound(soundType); if (sound == null) { return; } - disSound = SoundGroup.getGroup(disguise); + SoundGroup disSound = SoundGroup.getGroup(disguise); - if (disSound == null) { + if (disSound == null || disSound == entitySoundGroup) { return; } @@ -262,6 +262,7 @@ public class PacketListenerSounds extends PacketAdapter { mods.write(6, pitch); + event.setCancelled(true); try { ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false); } catch (InvocationTargetException e) {