Open source
Compendium: the plugin library under Avicus
The shared Bukkit and BungeeCord library under Avicus, which I worked on from 2016 to 2024: countdowns, boss bars, matchers and translated errors.
- 8 yearsof maintenance, 2016 to 2024
- ~100commits
The problem
Every Avicus plugin needed the same building blocks: countdowns, boss bars, settings, commands and translated messages. Writing them per plugin meant writing them badly several times.
What I built
Close to 100 commits over eight years, including:
- The countdown system: a
Countdownwith start, tick, end and cancel hooks, run once a second by aCountdownManager, plus commands to change a running countdown’s time - Boss bars that work on every client version. The manager checks the player’s protocol and picks a legacy or modern bar, and I later swapped our in-house legacy bars for the Bossy library
- Material matchers that can describe themselves, for objectives and filters
- Translatable command exceptions, so errors and warnings show in the player’s language
- A dynamic command manager, and an update to Java 17 on top of SportPaper in 2024
- Pluginsubclasses Countdown
- Managerstarts a 1 s task
- Tickper-player boss bars
- Commandscancel or change time
- Endmay start the next one
The countdown lifecycle
manager.start(countdown):
task = CountdownTask(countdown)
running[countdown] = task
countdown.on_start()
task.run_every(20 ticks) # once a second
fire(CountdownStartEvent(countdown))
task.tick():
elapsed += 1
if remaining() <= 0:
countdown.on_end(); manager.remove(countdown)
else:
countdown.on_tick(elapsed, remaining())
countdown.boss_bar(player) =
bars.compute_if_absent(player.id, bossBarManager.create(player)) # legacy or modern by protocol
task.set_new_duration(d): elapsed = 0; countdown.duration = d
Why it matters
Atlas’s phases, match start timers and a lot of the network’s other plugins were built on this, so fixing something once fixed it everywhere.