Skip to content

Conversation

@pistonpoek
Copy link
Contributor

Updates the SoundTypeBuilderImpl to create a codec that is fully interpreted by the vanilla SoundEventRegistrationSerialization, as this is what the soundType tries to provide. The links between the implementation records and their vanilla classes are being made explicit with additional documentation.

For the public API this means that a replace options has been added and the category method of the soundTypeBuilder has been made deprecated, as it wasn't processed by vanilla and thus provides no functionality.

News tests are also added. The class SoundTypeBuilderTest tests if the SoundTypeBuilder actually provides the expected SoundType. The class SoundTypeCodecTest tests if the implementation codec generates json that is interpreted to the expected vanilla objects.

Small additional tweaks that have been made are using the existing default variables in matching places and additional validation in the Entry codec to match what is being checked at the builder.

Extend the sound type builder with the missing replace value that is accepted by the vanilla SoundEventRegistrationSerializer.
Add API note to clarify the existence of the category field.
Add codec validation to the sound class record.
Add additional documentation comments making the goal of data generation explicit.
Remove the category field of the sound event registration class to be added in data generation, as it is not interpreted by vanilla in the sounds file.
Update codec to match validation with entry builder.
Add test class for sound type builder to ensure sound types are build correctly.
Add test class for sound type codec to ensure sound types generate and are interpreted to sound event registration classes as expected.
Clarify deprecated behavior of category method.
Update param doc to conform to yarn conventions
Remove see tag that might be more distracting than helpful
Remove unused imports.
Remove space indentation.
Apply Spotless to add licenses.
Fix package name of sounds test.
Replace hard coded value checks with the already existing default variables.
Add default implementation to deprecated method, so implementation does not need to use it anymore.
@pistonpoek pistonpoek changed the title Updates sounds.json data generation to match vanilla Update sounds.json data generation to match vanilla Dec 7, 2025
Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, the tests are really good to have.

* @deprecated Category is not a field interpreted by vanilla in the sounds file,
* calling this method will have no effect.
*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use @Deprecated(forRemoval = true) if we know its tottaly broken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems sensible to eventually want to get rid of it. I will add a commit for it.

@modmuss50 modmuss50 added bug Something isn't working priority: medium Medium priority PRs that should get reviews status: merge me please Pull requests that are ready to merge labels Dec 7, 2025
Add for removal to category property method.
@modmuss50 modmuss50 merged commit ae10562 into FabricMC:1.21.11 Dec 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Medium priority PRs that should get reviews status: merge me please Pull requests that are ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants