Class BossBarDisplay

java.lang.Object
me.totalfreedom.display.BossBarDisplay

public class BossBarDisplay extends Object
This class is a wrapper for BossBar objects. It provides some handy methods for changing the boss bar's properties, displaying the bar to Audiences, and a BossBarDisplay.BossBarBuilder to easily create new boss bars.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A Builder class for BossBar objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BossBarDisplay(net.kyori.adventure.bossbar.BossBar bossBar)
    Creates a new BossBarDisplay object.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    changeColor(net.kyori.adventure.bossbar.BossBar.Color color)
    Changes the boss bar's color.
    void
    Changes the boss bar's name with a String.
    void
    changeName(String name, net.kyori.adventure.text.format.TextColor color)
    Changes the boss bar's name with a String and a TextColor.
    void
    changeName(net.kyori.adventure.text.Component name)
    Changes the boss bar's name using a Component.
    void
    changeOverlay(net.kyori.adventure.bossbar.BossBar.Overlay overlay)
    Changes the boss bar's color.
    void
    decrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress)
    Decrements the Bar's progress by the specified amount.
    net.kyori.adventure.bossbar.BossBar
     
    void
    Sets the Bar's progress to half of the maximum amount (half bar).
    void
    hideForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience)
    Hides this Boss Bar from the specified ForwardingAudience.
    void
    hideFrom(net.kyori.adventure.audience.Audience audience)
    Hides this Boss Bar from the specified Audience.
    void
    incrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress)
    Increments the Bar's progress by the specified amount.
    void
    Sets the Bar's progress to the maximum amount (full bar).
    void
    Sets the Bar's progress to the minimum amount (empty bar).
    void
    setBossBar(net.kyori.adventure.bossbar.BossBar bossBar)
    Sets the BossBar object that this class wraps.
    void
    showForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience)
    Shows this Boss Bar to the specified ForwardingAudience.
    void
    showTo(net.kyori.adventure.audience.Audience audience)
    Shows this Boss Bar to the specified Audience.

    Methods inherited from class java.lang.Object

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

    • BossBarDisplay

      public BossBarDisplay(net.kyori.adventure.bossbar.BossBar bossBar)
      Creates a new BossBarDisplay object.
      Parameters:
      bossBar - The BossBar to wrap.
  • Method Details

    • builder

      public static BossBarDisplay.BossBarBuilder builder()
      Returns:
      A new BossBarDisplay.BossBarBuilder object.
    • changeColor

      public void changeColor(net.kyori.adventure.bossbar.BossBar.Color color)
      Changes the boss bar's color.
      Parameters:
      color - The new color.
    • changeOverlay

      public void changeOverlay(net.kyori.adventure.bossbar.BossBar.Overlay overlay)
      Changes the boss bar's color.
      Parameters:
      overlay - The new overlay.
    • changeName

      public void changeName(net.kyori.adventure.text.Component name)
      Changes the boss bar's name using a Component.
      Parameters:
      name - The new name.
    • changeName

      public void changeName(String name, net.kyori.adventure.text.format.TextColor color)
      Changes the boss bar's name with a String and a TextColor.
      Parameters:
      name - The new name.
      color - The name color.
    • changeName

      public void changeName(String name)
      Changes the boss bar's name with a String.
      Parameters:
      name - The new name.
    • showTo

      public void showTo(net.kyori.adventure.audience.Audience audience)
      Shows this Boss Bar to the specified Audience.
      Parameters:
      audience - The Audience to show the Boss Bar to.
    • getBossBar

      public net.kyori.adventure.bossbar.BossBar getBossBar()
      Returns:
      The BossBar object that this class wraps.
    • setBossBar

      public void setBossBar(net.kyori.adventure.bossbar.BossBar bossBar)
      Sets the BossBar object that this class wraps.
      Parameters:
      bossBar - The new BossBar object.
    • hideFrom

      public void hideFrom(net.kyori.adventure.audience.Audience audience)
      Hides this Boss Bar from the specified Audience.
      Parameters:
      audience - The Audience to hide the Boss Bar from.
    • incrementProgress

      public void incrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress)
      Increments the Bar's progress by the specified amount. This must be a range from 0 to 100.
      Parameters:
      progress - The new progress.
    • decrementProgress

      public void decrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress)
      Decrements the Bar's progress by the specified amount. This must be a range from 0 to 100.
      Parameters:
      progress - The new progress.
    • maximumProgress

      public void maximumProgress()
      Sets the Bar's progress to the maximum amount (full bar).
    • halfProgress

      public void halfProgress()
      Sets the Bar's progress to half of the maximum amount (half bar).
    • minimumProgress

      public void minimumProgress()
      Sets the Bar's progress to the minimum amount (empty bar).
    • showForwarded

      public void showForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience)
      Shows this Boss Bar to the specified ForwardingAudience.
      Parameters:
      forwardingAudience - The ForwardingAudience to show the Boss Bar to.
    • hideForwarded

      public void hideForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience)
      Hides this Boss Bar from the specified ForwardingAudience.
      Parameters:
      forwardingAudience - The ForwardingAudience to hide the Boss Bar from.