java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.resources.sound.YamlSoundRepository
All Implemented Interfaces:
SoundRepository

public final class YamlSoundRepository extends Object implements SoundRepository
A class that implements SoundRepository interface
  • Constructor Details

    • YamlSoundRepository

      public YamlSoundRepository(org.bukkit.plugin.Plugin plugin, ResourceManager soundResourceManager)
      Class constructor
  • Method Details

    • getRecord

      public SoundRecord getRecord(Enum<?> soundId)
      Specified by:
      getRecord in interface SoundRepository
    • getRecord

      public SoundRecord getRecord(String soundId)
    • getKeys

      public Set<String> getKeys()
      Description copied from interface: SoundRepository
      get all keys from the sound configuration
      Specified by:
      getKeys in interface SoundRepository
      Returns:
      a Collection of Section of sound configuration keys
    • isValidBukkitSoundName

      public boolean isValidBukkitSoundName(String key)
      Description copied from interface: SoundRepository
      Test string is valid bukkit sound name
      Specified by:
      isValidBukkitSoundName in interface SoundRepository
      Parameters:
      key - the string to test
      Returns:
      true if passed string is contained in the bukkit sounds enum; false if not
    • isRegistrySound

      public boolean isRegistrySound(String name)
      Specified by:
      isRegistrySound in interface SoundRepository
    • isValidSoundConfigKey

      public boolean isValidSoundConfigKey(String key)
      Description copied from interface: SoundRepository
      Test string is valid sound config key in sounds.yml file
      Specified by:
      isValidSoundConfigKey in interface SoundRepository
      Parameters:
      key - the string to test
      Returns:
      true if passed string is a valid key in sounds.yml file; false if not
    • getBukkitSoundName

      public String getBukkitSoundName(String key)
      Get bukkit sound name for sound config file key
      Specified by:
      getBukkitSoundName in interface SoundRepository
      Parameters:
      key - sound config file key
      Returns:
      Section - the bukkit sound name for key
    • play

      public void play(org.bukkit.command.CommandSender sender, Enum<?> soundId)
      Play sound effect for player
      Specified by:
      play in interface SoundRepository
      Parameters:
      sender - the command sender (player) to play sound
      soundId - the sound identifier enum member
    • play

      public void play(org.bukkit.command.CommandSender sender, String soundId)
      Play sound effect for player
      Specified by:
      play in interface SoundRepository
      Parameters:
      sender - the command sender (player) to play sound
      soundId - the sound identifier enum member
    • play

      public void play(org.bukkit.Location location, Enum<?> soundId)
      Play sound effect for location
      Specified by:
      play in interface SoundRepository
      Parameters:
      location - the location at which to play sound
      soundId - the sound identifier enum member
    • soundEffectsDisabled

      public boolean soundEffectsDisabled()
      Specified by:
      soundEffectsDisabled in interface SoundRepository
    • matchLongest

      public Optional<String> matchLongest(Enum<?> messageId)
      Specified by:
      matchLongest in interface SoundRepository