Class SoundDefinition


  • public final class SoundDefinition
    extends java.lang.Object
    Contains all the data to completely define a sound event.
    • Field Detail

      • replace

        private boolean replace
      • subtitle

        private java.lang.String subtitle
    • Constructor Detail

      • SoundDefinition

        private SoundDefinition()
    • Method Detail

      • replace

        public SoundDefinition replace​(boolean 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

        public SoundDefinition subtitle​(@Nullable
                                        java.lang.String 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

        public SoundDefinition with​(SoundDefinition.Sound sound)
        Adds the given sound to this sound definition.
        Parameters:
        sound - The sound to add.
        Returns:
        This definition for chaining.
      • with

        public SoundDefinition with​(SoundDefinition.Sound... sounds)
        Adds the given sounds to this sound definition.
        Parameters:
        sounds - The sounds to add.
        Returns:
        This definition for chaining.
      • serialize

        com.google.gson.JsonObject serialize()