Class SoundDefinition
java.lang.Object
net.neoforged.neoforge.common.data.SoundDefinition
Contains all the data to completely define a sound event.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Identifies a specific sound that has to be played in a sound event, along with all the necessary parameters.static enum
Represents the type of sound that theSoundDefinition.Sound
object represents. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SoundDefinition
Creates a newSoundDefinition
, which will host a set ofSoundDefinition.Sound
s and the necessary parameters.replace
(boolean replace) Sets whether this definition should replace any other definition for the same sound event previously applied, rather than overwriting it.(package private) com.google.gson.JsonObject
(package private) List
<SoundDefinition.Sound> Sets the language key for the subtitle that will be displayed whenever this sound is being played.with
(SoundDefinition.Sound sound) Adds the given sound to this sound definition.with
(SoundDefinition.Sound... sounds) Adds the given sounds to this sound definition.
-
Field Details
-
sounds
-
replace
private boolean replace -
subtitle
-
-
Constructor Details
-
SoundDefinition
private SoundDefinition()
-
-
Method Details
-
definition
Creates a newSoundDefinition
, which will host a set ofSoundDefinition.Sound
s and the necessary parameters. -
replace
Sets whether this definition should replace any other definition for the same sound event previously applied, rather than overwriting it.- Parameters:
replace
- Whether this definition replaces or not.- Returns:
- This definition for chaining.
-
subtitle
Sets the language key for the subtitle that will be displayed whenever this sound is being played.The subtitle is optional and the game will skip displaying it if it isn't present.
- Parameters:
subtitle
- The subtitle to display, or null to disable.- Returns:
- This definition for chaining.
-
with
Adds the given sound to this sound definition.- Parameters:
sound
- The sound to add.- Returns:
- This definition for chaining.
-
with
Adds the given sounds to this sound definition.- Parameters:
sounds
- The sounds to add.- Returns:
- This definition for chaining.
-
soundList
List<SoundDefinition.Sound> soundList() -
serialize
com.google.gson.JsonObject serialize()
-