sound group extract name

This commit is contained in:
Bixilon 2022-05-24 22:08:11 +02:00
parent 2fa384be01
commit 5c15bdd5eb
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -20,7 +20,10 @@ object SoundGroupGenerator : Generator(
continue
}
val data = compound()
val group = field.get(null) as BlockSoundGroup
val group = field.get(null)
if (group !is BlockSoundGroup) {
continue
}
val id = ids.size
ids[group] = id
@ -30,6 +33,7 @@ object SoundGroupGenerator : Generator(
if (group.volume != 1.0f) {
data["sound_type_pitch"] = group.pitch
}
data["name"] = field.name.lowercase()
data["break_sound_type"] = Registry.SOUND_EVENT.getRawId(group.breakSound)
data["step_sound_type"] = Registry.SOUND_EVENT.getRawId(group.stepSound)
data["place_sound_type"] = Registry.SOUND_EVENT.getRawId(group.placeSound)