Skip to content

Added bossbar feature - #83

Open
nicolaigrv wants to merge 5 commits into
MartenM:masterfrom
nicolaigrv:enhancement/bossbar
Open

Added bossbar feature#83
nicolaigrv wants to merge 5 commits into
MartenM:masterfrom
nicolaigrv:enhancement/bossbar

Conversation

@nicolaigrv

Copy link
Copy Markdown
Contributor

Hello, this PR adds a bossbar option.

Options

the bossbar feature supports the following options:

SettingWhat it does
titlemessage shown on the bossbar (supports '&' color codes)
progressthe progress of the bossbar (between 0.0 and 1.0)
colorcolor of the bossbar (supported colors)
stylestyle of the bossbar (supported styles)
show-aftertime until the bossbar should be shown (in seconds)
hide-aftertime until the bossbar should be hidden (in seconds)

The runnable controlling when to hide and show the bossbar will also automatically cancel itself when either the point has finished or hide-after has been reached to save resources.

Default values

title: empty, bossbar will not be shown
progress: 1.0
color: WHITE
style: SOLID
show-after: 0.0
hide-after: duration of the point

Example

bossbar:
title: '&4Text'color: BLUEstyle: SEGMENTED_12progress: 0.6show-after: 2.5hide-after: 3.5
ServerTutorialPlus.bossbar.mp4

@MartenM

Copy link
Copy Markdown
Owner

Seems to be quite an okay PR.
Will be testing this later this week probably.

@MartenMMartenM left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, but seems to be missing an editor that allows to change this in-game.
Please attach one. See other settings for how this is done.

try {
String bossBarStyleString = tutorialSaves.getString("tutorials." + ID + ".points." + i + ".bossbar.style", "SOLID");
bossBarStyle = BarStyle.valueOf(bossBarStyleString.toUpperCase());
} catch (IllegalArgumentException e) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason for the 'try-catch' blocks here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the exception IllegalArgumentException is caught when the valueOf method is called on the BarStyle enum with a string that doesn't match any of the enum constants.

@nicolaigrv

Copy link
Copy Markdown
ContributorAuthor

latest commit added the editor command /st editpoint

bossbar <title/progress/color/style/show-after/hide-after>

@nicolaigrv
nicolaigrv requested a review from MartenMMay 6, 2024 13:28
@mawoka-myblock

Copy link
Copy Markdown

Any progress as I'm personally interested in this feature, but already thanks for your work guys!

@MartenM

Copy link
Copy Markdown
Owner

I'm quite busy with my personal life right now.
It's still on my radar to review & merge this.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@nicolaigrv@MartenM@mawoka-myblock