Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound IDs are incorrect for 1.19.3 #43

Open
j-tai opened this issue Dec 25, 2022 · 3 comments
Open

Sound IDs are incorrect for 1.19.3 #43

j-tai opened this issue Dec 25, 2022 · 3 comments

Comments

@j-tai
Copy link

j-tai commented Dec 25, 2022

Burger produces incorrect sound IDs for Minecraft 1.19.3.

From my own observations & empirical testing*, it looks like Burger is making two errors:

  • Sound IDs start from 1, not 0. The first sound, entity.allay.ambient_with_item, has ID 1, not 0.
  • The output is missing goat horn sounds, causing all sounds after it to have IDs offset. Goat horn sounds are added in its own method (net.minecraft.sound.SoundEvents#registerGoatHornSounds() in yarn mappings). Probably Burger's static code analysis does not account for this.

Here are the sound IDs for 1.19.3 (by decompiling Minecraft + some vim macros). I tested a handful of sounds and these seem to be accurate. sounds.txt

*I tested this by sending a Sound Effect packet with the appropriate ID and observing the sound that gets played

@Pokechu22
Copy link
Owner

It looks like data generators include minecraft:sound_event now, which should provide the correct IDs as well. They seem to match what you have, except that they do start at 0 instead of 1 (entity.zombie_villager.step is 1391 and entity.allay.ambient_with_item is 0). Maybe that offset comes from elsewhere? I'm not sure how much work I want to put into fixing this, though.

@j-tai
Copy link
Author

j-tai commented Dec 26, 2022

Thanks! I will look into data generators.

It looks like the packet uses the sound ID plus one; see net.minecraft.network.PacketByteBuf#writeRegistryEntry (yarn mappings). The +1 offset probably applies to more packets than just Sound Effect. Perhaps this should be documented on wiki.vg.

@Pokechu22
Copy link
Owner

Ah, right. Burger actually accounts for that in the packet decompilation (see PLAY_CLIENTBOUND_5E and the fairly jank code responsible for it). This should definitely be documented on wiki.vg. It looks like it's only used by Sound Effect and Entity Sound Effect though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants