Refuse to handle null sounds

This commit is contained in:
libraryaddict 2024-07-23 10:21:19 +12:00
parent 29673b7dd3
commit ab63cdbbd9

View File

@ -42,7 +42,6 @@ public class PacketListenerSounds extends SimplePacketListenerAbstract {
return;
}
Sound sound;
float volume;
float pitch;
@ -57,6 +56,11 @@ public class PacketListenerSounds extends SimplePacketListenerAbstract {
volume = soundEffect.getVolume();
pitch = soundEffect.getPitch();
sound = soundEffect.getSound();
if (sound == null) {
return;
}
String soundKey = NmsVersion.v1_16.isSupported() ? sound.getSoundId().toString() : sound.getSoundId().getKey();
Vector3i loc = soundEffect.getEffectPosition();
@ -106,6 +110,10 @@ public class PacketListenerSounds extends SimplePacketListenerAbstract {
pitch = entitySoundEffect.getPitch();
sound = entitySoundEffect.getSound();
if (sound == null) {
return;
}
disguise = DisguiseUtilities.getDisguise(observer, entitySoundEffect.getEntityId());
}