Accidentally removed a cancel, don't bother sending our sound packets if we're not modifying the sound groups

This commit is contained in:
libraryaddict 2021-11-11 23:08:44 +13:00
parent e7b370733f
commit bc9ebac4d5
1 changed files with 6 additions and 5 deletions

View File

@ -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) {