Class NoteBlockAPI

java.lang.Object
com.ranull.graves.integration.NoteBlockAPI

public class NoteBlockAPI extends Object
Utility class to handle playing and stopping NoteBlockAPI songs for individual players or all players on the server.
  • Field Details

    • plugin

      private final Graves plugin
    • activeSongPlayers

      private final Map<Object,com.xxmicloxx.NoteBlockAPI.songplayer.SongPlayer> activeSongPlayers
  • Constructor Details

    • NoteBlockAPI

      public NoteBlockAPI(Graves plugin)
      Constructs a new NoteBlockAPI instance.
      Parameters:
      plugin - the Graves plugin instance.
  • Method Details

    • playSongForPlayer

      public void playSongForPlayer(org.bukkit.entity.Player player, String fileName)
      Plays an NBS song file for a specified player.
      Parameters:
      player - the player to play the song for.
      fileName - the name of the NBS file located in the /nbs directory.
    • playSongForAllPlayers

      public void playSongForAllPlayers(String fileName)
      Plays an NBS song file for all online players on the server.
      Parameters:
      fileName - the name of the NBS file located in the /nbs directory.
    • stopSongForPlayer

      public void stopSongForPlayer(org.bukkit.entity.Player player)
      Stops the currently playing song for a specific player.
      Parameters:
      player - the player for whom to stop the song.
    • stopSongForPlayer

      public void stopSongForPlayer(UUID uuid)
      Stops the currently playing song for a specific player.
      Parameters:
      uuid - the player uuid for whom to stop the song.
    • stopSongForAllPlayers

      public void stopSongForAllPlayers()
      Stops the currently playing song for all players.
    • stopAllSongs

      public void stopAllSongs()
      Stops all active song players.
    • isSongPlayingForPlayer

      public boolean isSongPlayingForPlayer(org.bukkit.entity.Player player)
      Checks if a song is currently playing for a specific player.
      Parameters:
      player - the player to check for active song playback.
      Returns:
      true if a song is actively playing for the player, false otherwise.
    • isSongPlayingForPlayer

      public boolean isSongPlayingForPlayer(UUID uuid)
      Checks if a song is currently playing for a specific player.
      Parameters:
      uuid - the player's UUID to check for active song playback.
      Returns:
      true if a song is actively playing for the player, false otherwise.
    • isSongPlayingForAllPlayers

      public boolean isSongPlayingForAllPlayers()
      Checks if a song is currently playing for all players.
      Returns:
      true if a song is actively playing for all players, false otherwise.