Class CartSoundProvider

java.lang.Object
com.mrbysco.chowderexpress.datagen.assets.CartSoundProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider

public class CartSoundProvider extends Object implements net.minecraft.data.DataProvider
  • Field Details

    • dataOutput

      protected final net.fabricmc.fabric.api.datagen.v1.FabricPackOutput dataOutput
  • Constructor Details

    • CartSoundProvider

      public CartSoundProvider(net.fabricmc.fabric.api.datagen.v1.FabricPackOutput dataOutput)
  • Method Details

    • registerSounds

      public void registerSounds()
      Registers the sound definitions that should be generated via one of the add methods.
    • modSubtitle

      public String modSubtitle(net.minecraft.resources.Identifier id)
    • run

      public CompletableFuture<?> run(net.minecraft.data.CachedOutput cache)
      Specified by:
      run in interface net.minecraft.data.DataProvider
    • getName

      public String getName()
      Specified by:
      getName in interface net.minecraft.data.DataProvider
    • definition

      protected static SoundDefinition definition()
      Creates a new SoundDefinition, which will host a set of SoundDefinition.Sounds and the necessary parameters.
    • sound

      protected static SoundDefinition.Sound sound(net.minecraft.resources.Identifier name, SoundDefinition.SoundType type)
      Creates a new sound with the given name and type.
      Parameters:
      name - The name of the sound to create.
      type - The type of sound to create.
    • sound

      protected static SoundDefinition.Sound sound(net.minecraft.resources.Identifier name)
      Creates a new sound with the given name and SoundDefinition.SoundType.SOUND as sound type.
      Parameters:
      name - The name of the sound to create.
    • add

      protected void add(Supplier<net.minecraft.sounds.SoundEvent> soundEvent, SoundDefinition definition)
      Adds the entry name associated with the supplied SoundEvent with the given SoundDefinition to the list.

      This method should be preferred when dealing with a RegistryObject or RegistryDelegate.

      Parameters:
      soundEvent - A Supplier for the given SoundEvent.
      definition - A SoundDefinition that defines the given sound.
    • add

      protected void add(net.minecraft.sounds.SoundEvent soundEvent, SoundDefinition definition)
      Adds the entry name associated with the given SoundEvent with the SoundDefinition to the list.

      This method should be preferred when a SoundEvent is already available in the method context. If you already have a Supplier for it, refer to add(Supplier, SoundDefinition).

      Parameters:
      soundEvent - A SoundEvent.
      definition - The SoundDefinition that defines the given event.
    • add

      protected void add(net.minecraft.resources.Identifier soundEvent, SoundDefinition definition)
      Adds the SoundEvent referenced by the given Identifier with the SoundDefinition to the list.
      Parameters:
      soundEvent - The Identifier that identifies the event.
      definition - The SoundDefinition that defines the given event.
    • add

      protected void add(String soundEvent, SoundDefinition definition)
      Adds the SoundEvent with the specified name along with its SoundDefinition to the list.

      The given sound event must NOT contain the namespace the name is a part of, since the sound definition specification doesn't allow sounds to be defined outside the namespace they're in. For this reason, any namespace will automatically be stripped from the name.

      Parameters:
      soundEvent - The name of the SoundEvent.
      definition - The SoundDefinition that defines the given event.