Package com.ranull.graves.integration
Class NoteBlockAPI
java.lang.Object
com.ranull.graves.integration.NoteBlockAPI
Utility class to handle playing and stopping NoteBlockAPI songs for individual players or all players on the server.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a song is currently playing for all players.boolean
isSongPlayingForPlayer
(UUID uuid) Checks if a song is currently playing for a specific player.boolean
isSongPlayingForPlayer
(org.bukkit.entity.Player player) Checks if a song is currently playing for a specific player.void
playSongForAllPlayers
(String fileName) Plays an NBS song file for all online players on the server.void
playSongForPlayer
(org.bukkit.entity.Player player, String fileName) Plays an NBS song file for a specified player.void
Stops all active song players.void
Stops the currently playing song for all players.void
stopSongForPlayer
(UUID uuid) Stops the currently playing song for a specific player.void
stopSongForPlayer
(org.bukkit.entity.Player player) Stops the currently playing song for a specific player.
-
Field Details
-
plugin
-
activeSongPlayers
-
-
Constructor Details
-
NoteBlockAPI
Constructs a new NoteBlockAPI instance.- Parameters:
plugin
- the Graves plugin instance.
-
-
Method Details
-
playSongForPlayer
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
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
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
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.
-