Interface ZentrixBroadcast


public interface ZentrixBroadcast
Represents a read-only view of a broadcast configuration.

Broadcasts are periodic messages sent to players in specific game states. They support different formats including chat messages, titles, and action bars.

Example Usage


 BroadcastService service = ZentrixAPI.get().getBroadcastService();

 Optional<ZentrixBroadcast> broadcast = service.getBroadcast("tips");
 broadcast.ifPresent(b -> {
     System.out.println("Broadcast: " + b.getId());
     System.out.println("Type: " + b.getType());
     System.out.println("Interval: " + b.getInterval() + "s");
     System.out.println("Enabled: " + b.isEnabled());
 });
 
Since:
1.1.0
  • Method Details

    • getId

      @NotNull @NotNull String getId()
      Gets the unique identifier for this broadcast.
      Returns:
      The broadcast ID (never null)
    • isEnabled

      boolean isEnabled()
      Checks if this broadcast is enabled.
      Returns:
      true if the broadcast is enabled
    • getInterval

      int getInterval()
      Gets the interval between broadcasts in seconds.
      Returns:
      The interval in seconds
    • getShowInStates

      @NotNull @NotNull Set<GameState> getShowInStates()
      Gets the game states in which this broadcast is shown.
      Returns:
      An unmodifiable set of game states (never null, may be empty)
    • showsInState

      boolean showsInState(@NotNull @NotNull GameState state)
      Checks if this broadcast should be shown in the given state.
      Parameters:
      state - The game state to check
      Returns:
      true if the broadcast is shown in this state
    • getType

      @NotNull @NotNull BroadcastType getType()
      Gets the type of this broadcast.
      Returns:
      The broadcast type (never null)
    • getMessages

      @NotNull @NotNull List<String> getMessages()
      Gets the messages for a CHAT type broadcast.

      For CHAT broadcasts, messages are rotated or randomly selected.

      Returns:
      An unmodifiable list of messages (never null, may be empty for non-CHAT types)
    • getTitle

      @NotNull @NotNull Optional<String> getTitle()
      Gets the title text for a TITLE type broadcast.
      Returns:
      Optional containing the title, or empty if not a TITLE type
    • getSubtitle

      @NotNull @NotNull Optional<String> getSubtitle()
      Gets the subtitle text for a TITLE type broadcast.
      Returns:
      Optional containing the subtitle, or empty if not set
    • getFadeIn

      int getFadeIn()
      Gets the fade-in time for TITLE broadcasts in ticks.
      Returns:
      The fade-in time (default 10)
    • getStay

      int getStay()
      Gets the stay time for TITLE broadcasts in ticks.
      Returns:
      The stay time (default 70)
    • getFadeOut

      int getFadeOut()
      Gets the fade-out time for TITLE broadcasts in ticks.
      Returns:
      The fade-out time (default 20)
    • getActionBar

      @NotNull @NotNull Optional<String> getActionBar()
      Gets the action bar message for an ACTIONBAR type broadcast.
      Returns:
      Optional containing the action bar message, or empty if not an ACTIONBAR type
    • getAddonId

      @NotNull @NotNull Optional<String> getAddonId()
      Gets the addon ID that registered this broadcast.
      Returns:
      Optional containing the addon ID, or empty if not addon-registered
    • isDynamicallyRegistered

      boolean isDynamicallyRegistered()
      Checks if this broadcast was dynamically registered by an addon.
      Returns:
      true if dynamically registered
    • getCustomFields

      @NotNull @NotNull Map<String,Object> getCustomFields()
      Gets custom metadata fields for this broadcast.
      Returns:
      An unmodifiable map of custom fields (never null, may be empty)