Class DiscEntry

java.lang.Object
space.subkek.customdiscs.api.DiscEntry

public class DiscEntry extends Object
Represents a custom music disc entry within the system.

This class acts as a data container that links a physical Minecraft ItemStack with its corresponding audio source metadata and identifier.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DiscEntry(org.bukkit.inventory.ItemStack disc, net.kyori.adventure.text.Component name, String identifier, boolean local)
    Constructs a new DiscEntry.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.inventory.ItemStack
    Returns the physical item associated with this music disc.
    @NotNull String
    Returns the unique identifier of the audio source.
    @NotNull net.kyori.adventure.text.Component
    Returns the formatted display name of the disc track.
    boolean
    Indicates whether the audio source is located on the local server storage.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DiscEntry

      public DiscEntry(org.bukkit.inventory.ItemStack disc, net.kyori.adventure.text.Component name, String identifier, boolean local)
      Constructs a new DiscEntry.
      Parameters:
      disc - The ItemStack representing the disc in game.
      name - The display name of the track (e.g., used for action bars or tooltips).
      identifier - The source identifier (URL, file path, or unique ID) used to load the audio.
      local - true if the source is stored on the local filesystem, false if it is a remote resource.
  • Method Details

    • getDisc

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getDisc()
      Returns the physical item associated with this music disc.
      Returns:
      The ItemStack of the disc.
    • getName

      @NotNull public @NotNull net.kyori.adventure.text.Component getName()
      Returns the formatted display name of the disc track. Usually displayed to the player when the disc starts playing.
      Returns:
      The track name as an Adventure Component.
    • getIdentifier

      @NotNull public @NotNull String getIdentifier()
      Returns the unique identifier of the audio source. This string is used by the audio engine to resolve and play the track.
      Returns:
      The source string (e.g., a URL or a local file path).
    • isLocal

      public boolean isLocal()
      Indicates whether the audio source is located on the local server storage.
      Returns:
      true if the source is local; false if it is a remote stream.