Package me.totalfreedom.display
Class BossBarDisplay
java.lang.Object
me.totalfreedom.display.BossBarDisplay
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 ClassesModifier and TypeClassDescriptionstatic final classA Builder class forBossBarobjects. -
Constructor Summary
ConstructorsConstructorDescriptionBossBarDisplay(net.kyori.adventure.bossbar.BossBar bossBar) Creates a newBossBarDisplayobject. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidchangeColor(net.kyori.adventure.bossbar.BossBar.Color color) Changes the boss bar's color.voidchangeName(String name) Changes the boss bar's name with a String.voidchangeName(String name, net.kyori.adventure.text.format.TextColor color) Changes the boss bar's name with a String and aTextColor.voidchangeName(net.kyori.adventure.text.Component name) Changes the boss bar's name using aComponent.voidchangeOverlay(net.kyori.adventure.bossbar.BossBar.Overlay overlay) Changes the boss bar's color.voiddecrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress) Decrements the Bar's progress by the specified amount.net.kyori.adventure.bossbar.BossBarvoidSets the Bar's progress to half of the maximum amount (half bar).voidhideForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience) Hides this Boss Bar from the specifiedForwardingAudience.voidhideFrom(net.kyori.adventure.audience.Audience audience) Hides this Boss Bar from the specifiedAudience.voidincrementProgress(@org.jetbrains.annotations.Range(from=0L, to=100L) float progress) Increments the Bar's progress by the specified amount.voidSets the Bar's progress to the maximum amount (full bar).voidSets the Bar's progress to the minimum amount (empty bar).voidsetBossBar(net.kyori.adventure.bossbar.BossBar bossBar) Sets theBossBarobject that this class wraps.voidshowForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience) Shows this Boss Bar to the specifiedForwardingAudience.voidshowTo(net.kyori.adventure.audience.Audience audience) Shows this Boss Bar to the specifiedAudience.
-
Constructor Details
-
BossBarDisplay
public BossBarDisplay(net.kyori.adventure.bossbar.BossBar bossBar) Creates a newBossBarDisplayobject.- Parameters:
bossBar- TheBossBarto wrap.
-
-
Method Details
-
builder
- Returns:
- A new
BossBarDisplay.BossBarBuilderobject.
-
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 aComponent.- Parameters:
name- The new name.
-
changeName
Changes the boss bar's name with a String and aTextColor.- Parameters:
name- The new name.color- The name color.
-
changeName
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 specifiedAudience.- Parameters:
audience- TheAudienceto show the Boss Bar to.
-
getBossBar
public net.kyori.adventure.bossbar.BossBar getBossBar()- Returns:
- The
BossBarobject that this class wraps.
-
setBossBar
public void setBossBar(net.kyori.adventure.bossbar.BossBar bossBar) Sets theBossBarobject that this class wraps.- Parameters:
bossBar- The newBossBarobject.
-
hideFrom
public void hideFrom(net.kyori.adventure.audience.Audience audience) Hides this Boss Bar from the specifiedAudience.- Parameters:
audience- TheAudienceto 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 specifiedForwardingAudience.- Parameters:
forwardingAudience- TheForwardingAudienceto show the Boss Bar to.
-
hideForwarded
public void hideForwarded(net.kyori.adventure.audience.ForwardingAudience forwardingAudience) Hides this Boss Bar from the specifiedForwardingAudience.- Parameters:
forwardingAudience- TheForwardingAudienceto hide the Boss Bar from.
-