Record Class BossBar
java.lang.Object
java.lang.Record
net.flectone.pulse.model.value.BossBar
- Record Components:
duration- how long the bar stays on screen, in tickshealth- the filled fraction of the bar, from 0.0 to 1.0overlay- the segment style drawn over the barcolor- the bar colorflags- extra client effects such as fog or boss music
-
Constructor Summary
ConstructorsConstructorDescriptionBossBar(long duration, float health, net.kyori.adventure.bossbar.BossBar.Overlay overlay, net.kyori.adventure.bossbar.BossBar.Color color) Creates a boss bar with no extra flags.BossBar(long duration, float health, net.kyori.adventure.bossbar.BossBar.Overlay overlay, net.kyori.adventure.bossbar.BossBar.Color color, EnumSet<net.kyori.adventure.bossbar.BossBar.Flag> flags) Creates an instance of aBossBarrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.bossbar.BossBar.Colorcolor()Returns the value of thecolorrecord component.longduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.EnumSet<net.kyori.adventure.bossbar.BossBar.Flag> flags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.floathealth()Returns the value of thehealthrecord component.net.kyori.adventure.bossbar.BossBar.Overlayoverlay()Returns the value of theoverlayrecord component.final StringtoString()Returns a string representation of this record class.withFlag(net.kyori.adventure.bossbar.BossBar.Flag flag) Returns a copy of this bar with an extra flag enabled.
-
Constructor Details
-
BossBar
public BossBar(long duration, float health, net.kyori.adventure.bossbar.BossBar.Overlay overlay, net.kyori.adventure.bossbar.BossBar.Color color) Creates a boss bar with no extra flags.- Parameters:
duration- how long the bar stays on screen, in tickshealth- the filled fraction of the bar, from 0.0 to 1.0overlay- the segment style drawn over the barcolor- the bar color
-
BossBar
public BossBar(long duration, float health, net.kyori.adventure.bossbar.BossBar.Overlay overlay, net.kyori.adventure.bossbar.BossBar.Color color, EnumSet<net.kyori.adventure.bossbar.BossBar.Flag> flags) Creates an instance of aBossBarrecord class.
-
-
Method Details
-
withFlag
Returns a copy of this bar with an extra flag enabled.- Parameters:
flag- the flag to add- Returns:
- a new boss bar carrying the flag
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
duration
-
health
-
overlay
-
color
-
flags
-