Handle protocol version translators that may send -1 for sound IDs.

This commit is contained in:
Steveice10 2020-05-21 15:19:39 -07:00
parent 898b45ec6c
commit a5bc122b93

View file

@ -1206,6 +1206,10 @@ public class MagicValues {
register(SoundCategory.AMBIENT, 8); register(SoundCategory.AMBIENT, 8);
register(SoundCategory.VOICE, 9); register(SoundCategory.VOICE, 9);
// Handle some protocol version translators that may send -1 for untranslatable sound IDs.
// Choice of sound is based on what (I think?) vanilla would default to.
register(BuiltinSound.ENTITY_ITEM_PICKUP, -1);
for(BuiltinSound sound : BuiltinSound.values()) { for(BuiltinSound sound : BuiltinSound.values()) {
register(sound, sound.ordinal()); register(sound, sound.ordinal());
register(sound, sound.getName()); register(sound, sound.getName());