Class BossMessage

java.lang.Object
ml.karmaconfigs.api.common.boss.BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
ml.karmaconfigs.api.bungee.makeiteasy.BossMessage

public final class BossMessage extends BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
Karma boss bar message
  • Constructor Details

    • BossMessage

      public BossMessage(KarmaSource owner, String _message, double duration)
      Initialize the boss message
      Parameters:
      owner - the boss message source
      _message - the boss bar message
      duration - the boss bar duration
  • Method Details

    • color

      public BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer> color(BossColor newColor)
      Set the boss bar color
      Specified by:
      color in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      newColor - the boss bar color
      Returns:
      this boss bar instance
    • style

      public BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer> style(BossType newType)
      Set the boss bar style
      Specified by:
      style in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      newType - the boss bar style
      Returns:
      this boss bar instance
    • progress

      public BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer> progress(ProgressiveBar type)
      Set the boss bar progress type
      Specified by:
      progress in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      type - the boss bar progress type
      Returns:
      this boss bar instance
    • cancel

      public void cancel()
      Destroy the current boss bar
      Specified by:
      cancel in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
    • displayBar

      protected void displayBar(Collection<net.md_5.bungee.api.connection.ProxiedPlayer> players)
      Display the boss bar to the specified players
      Specified by:
      displayBar in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      players - the players to display to
    • scheduleBar

      public void scheduleBar(Collection<net.md_5.bungee.api.connection.ProxiedPlayer> players)
      Schedule the bar to the specified players
      Specified by:
      scheduleBar in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      players - the players to display to
    • scheduleBar

      public void scheduleBar(net.md_5.bungee.api.connection.ProxiedPlayer player)
      Schedule the bar to the specified player
      Specified by:
      scheduleBar in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      player - the player to display to
    • getBarsAmount

      public int getBarsAmount()
      Get the amount of bars that exist
      Specified by:
      getBarsAmount in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      the amount of bars created
    • getBarId

      public int getBarId()
      Get the current boss bar id
      Specified by:
      getBarId in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      the current boss bar id
    • update

      public boolean update(String _message, boolean restart)
      Update the boss bar
      Specified by:
      update in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      _message - the new boss bar text
      restart - restart the bar progress
      Returns:
      if the boss bar could be updated
    • displayTime

      public BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer> displayTime(double displayTime)
      Set the boss bar display time
      Specified by:
      displayTime in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      displayTime - the boss bar display time
      Returns:
      the boss bar display time
    • isValid

      public boolean isValid()
      Get if the boss bar is valid
      Specified by:
      isValid in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      if the boss bar is valid
    • isCancelled

      public boolean isCancelled()
      Get if the boss bar is cancelled
      Specified by:
      isCancelled in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      if the boss bar is cancelled
    • getTitle

      public String getTitle()
      Get the boss bar title
      Specified by:
      getTitle in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      the boss bar title
    • getColor

      public BossColor getColor()
      Get the boss bar color
      Specified by:
      getColor in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      the boss bar color
    • getStyle

      public BossType getStyle()
      Get the boss bar style
      Specified by:
      getStyle in class BossProvider<net.md_5.bungee.api.connection.ProxiedPlayer>
      Returns:
      the boss bar style