Class BossBarManager

java.lang.Object
com.storytimeproductions.stweaks.util.BossBarManager

public class BossBarManager extends Object
Manages Boss Bars that show each player's remaining playtime progress.

The BossBar updates every second and visualizes the remaining playtime in a "xxmxxs" format, reflecting how close the player is to reaching the daily 60-minute playtime requirement.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    init(org.bukkit.plugin.java.JavaPlugin pl)
    Initializes the BossBarManager and starts periodic updates for all online players.
    static void
    removeBossBar(org.bukkit.entity.Player player)
    Removes a player's boss bar (e.g., on logout).
    static void
    updateBossBar(org.bukkit.entity.Player player)
    Updates the Boss Bar for the given player to reflect their live playtime countdown.

    Methods inherited from class java.lang.Object

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

    • BossBarManager

      public BossBarManager()
  • Method Details

    • init

      public static void init(org.bukkit.plugin.java.JavaPlugin pl)
      Initializes the BossBarManager and starts periodic updates for all online players.
      Parameters:
      pl - The plugin instance.
    • updateBossBar

      public static void updateBossBar(org.bukkit.entity.Player player)
      Updates the Boss Bar for the given player to reflect their live playtime countdown.
      Parameters:
      player - The player to update.
    • removeBossBar

      public static void removeBossBar(org.bukkit.entity.Player player)
      Removes a player's boss bar (e.g., on logout).
      Parameters:
      player - The player to remove the boss bar for.