Package me.bimmr.bimmcore.messages
Class BossBar
- java.lang.Object
-
- me.bimmr.bimmcore.utils.timed.TimedObject
-
- me.bimmr.bimmcore.messages.MessageDisplay
-
- me.bimmr.bimmcore.messages.BossBar
-
public class BossBar extends MessageDisplay
A wrapper for the Bukkit BossBar API
-
-
Field Summary
-
Fields inherited from class me.bimmr.bimmcore.messages.MessageDisplay
text, time
-
Fields inherited from class me.bimmr.bimmcore.utils.timed.TimedObject
timedEvent
-
-
Constructor Summary
Constructors Constructor Description BossBar(java.lang.String text)
Create a BossbarBossBar(java.lang.String text, int time)
Create a BossBarBossBar(java.lang.String text, int time, TimedEvent timedEvent)
Create a BossBarBossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle)
Create a BossBar progress = 1.0BossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, java.lang.Double progress)
Create a BossBarBossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, java.lang.Double progress, TimedEvent timedEvent)
Create a BossBarBossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, TimedEvent timedEvent)
Create a BossBar progress = 1.0BossBar(java.lang.String text, TimedEvent timedEvent)
Create a Bossbar
-
Method Summary
Modifier and Type Method Description static void
clear(org.bukkit.entity.Player player)
Clear the BossBar being shown to the playerstatic BossBar
getBossBar(org.bukkit.entity.Player player)
Gets boss bar.org.bukkit.boss.BossBar
getBukkitBar()
Gets bukkit bar.java.lang.String
getText()
int
getTime()
Get the timeTimedEvent
getTimedEvent()
Gets timed event.void
send(org.bukkit.entity.Player player)
Sends a BossBar for a set amount of timevoid
setText(java.lang.String text)
Set the textvoid
setTimedEvent(TimedEvent timedEvent)
Set the TimedEventvoid
stop(org.bukkit.entity.Player player)
Clear the bossbar off the players screen-
Methods inherited from class me.bimmr.bimmcore.utils.timed.TimedObject
isTaskRunning, onTaskRun, setTimedEvent, setTimedEvent, setTimedEvent, startTask, stopTask
-
-
-
-
Constructor Detail
-
BossBar
public BossBar(java.lang.String text)
Create a Bossbartime = 2 color = white style = solid progress = 1.0
- Parameters:
text
- The Text
-
BossBar
public BossBar(java.lang.String text, int time)
Create a BossBarcolor = white style = solid progress = 1.0
- Parameters:
text
- The Texttime
- The Time
-
BossBar
public BossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle)
Create a BossBar progress = 1.0- Parameters:
text
- The texttime
- The timebarColor
- the BarcolorbarStyle
- The Barstyle
-
BossBar
public BossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, java.lang.Double progress)
Create a BossBar- Parameters:
text
- The texttime
- The TimebarColor
- The BarcolorbarStyle
- The BarStyleprogress
- The progress
-
BossBar
public BossBar(java.lang.String text, TimedEvent timedEvent)
Create a Bossbartime = 2 color = white style = solid progress = 1.0
- Parameters:
text
- The texttimedEvent
- The TimedEvent
-
BossBar
public BossBar(java.lang.String text, int time, TimedEvent timedEvent)
Create a BossBarcolor = white style = solid progress = 1.0
- Parameters:
text
- The texttime
- The timetimedEvent
- The TimedEvent
-
BossBar
public BossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, TimedEvent timedEvent)
Create a BossBar progress = 1.0- Parameters:
text
- The texttime
- The timebarColor
- The bar colorbarStyle
- The bar styletimedEvent
- The TimedEvent
-
BossBar
public BossBar(java.lang.String text, int time, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, java.lang.Double progress, TimedEvent timedEvent)
Create a BossBar- Parameters:
text
- The texttime
- The timebarColor
- The bar colorbarStyle
- The bar styleprogress
- The bar's progresstimedEvent
- The TimedEvent
-
-
Method Detail
-
clear
public static void clear(org.bukkit.entity.Player player)
Clear the BossBar being shown to the player- Parameters:
player
- the player
-
getBossBar
public static BossBar getBossBar(org.bukkit.entity.Player player)
Gets boss bar.- Parameters:
player
- The player- Returns:
- Get the BossBar being shown to the player
-
getTime
public int getTime()
Get the time- Specified by:
getTime
in classMessageDisplay
- Returns:
- the time left
-
stop
public void stop(org.bukkit.entity.Player player)
Clear the bossbar off the players screen- Specified by:
stop
in classMessageDisplay
- Parameters:
player
- The player
-
getBukkitBar
public org.bukkit.boss.BossBar getBukkitBar()
Gets bukkit bar.- Returns:
- Get the BukkitBossBar
-
getTimedEvent
public TimedEvent getTimedEvent()
Gets timed event.- Overrides:
getTimedEvent
in classTimedObject
- Returns:
- Get the TimedEvent
-
setTimedEvent
public void setTimedEvent(TimedEvent timedEvent)
Set the TimedEvent- Overrides:
setTimedEvent
in classTimedObject
- Parameters:
timedEvent
- The TimedEvent
-
getText
public java.lang.String getText()
- Specified by:
getText
in classMessageDisplay
- Returns:
- Get the text
-
setText
public void setText(java.lang.String text)
Set the text- Specified by:
setText
in classMessageDisplay
- Parameters:
text
- The text
-
send
public void send(org.bukkit.entity.Player player)
Sends a BossBar for a set amount of time- Specified by:
send
in classMessageDisplay
- Parameters:
player
- The player
-
-