Skip to content

Comments

Add Scoreboard/HUD support for Folia, convert Scoreboards to Adventure.#8115

Draft
LlmDl wants to merge 7 commits intomasterfrom
feat/TownyHud
Draft

Add Scoreboard/HUD support for Folia, convert Scoreboards to Adventure.#8115
LlmDl wants to merge 7 commits intomasterfrom
feat/TownyHud

Conversation

@LlmDl
Copy link
Member

@LlmDl LlmDl commented Feb 19, 2026

Description:

Adds a ServerHUD which is either a FoliaHUD or PaperHUD.

HUDImplementers like MapHUD and PermHUD be used to make instances of either PaperHUDs or FoliaHUD. MapHUD and PermHUD both require a HUD which is then used by FoliaHUD and PaperHUD.

The HUDManager class is used to track Towny's MapHUD and PermHUD.


New Nodes/Commands/ConfigOptions:


Relevant Towny Issue ticket:


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

Adds a ServerHUD which is either a FoliaHUD or PaperHUD.

HUDImplementers like MapHUD and PermHUD be used to make instances of
either PaperHUDs or FoliaHUD. MapHUD and PermHUD both require a HUD
which is then used by FoliaHUD and PaperHUD.

The HUDManager class is used to track Towny's MapHUD and PermHUD.
@LlmDl LlmDl added this to the 0.103.0.0 milestone Feb 19, 2026
@SulkyWhale
Copy link
Contributor

The old perm HUD:
old-Towny-hud
The new perm HUD at this point:
new-Towny-hud

De-duplicates methods in the Paper/Folia HUD.

Change Set<Player> to Set<UUID> in Paper/FoliaHUD.

Change PermHUD and MapHUD constructors to take in HUD instead of
building them internally.
@LlmDl
Copy link
Member Author

LlmDl commented Feb 20, 2026

The old perm HUD: old-Towny-hud The new perm HUD at this point: new-Towny-hud

I'm fixing this up, but I'm a bit puzzled at how the forsale and plot perms values are showing as white in your screenshot. We definitely called for them to be gray.

@SulkyWhale
Copy link
Contributor

I see that it is specified in the old code that it should be gray when initialised, but maybe Scoreboard#setSuffix does not respect that for the suffix (updated info)?

@LlmDl
Copy link
Member Author

LlmDl commented Feb 20, 2026

It could certainly be that way, the PVP-Mobspawns suffixes all had colouring in their transtalables.

Add miniMessage methods to shorten line length.
@SulkyWhale
Copy link
Contributor

The perm HUD now looks the same as the original except for the extra spaces after the "f", "r" etc. in the Key:
image

Comment on lines 84 to 85
sbComponents.add(miniMessage(DARK_GREEN + translator.of("town_sing") + ": "
+ (tb != null && tb.hasTown() ? tb.getTownOrNull().getName() : translator.of("status_no_town"))));
Copy link
Contributor

Choose a reason for hiding this comment

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

The color green needs to be applied after the colon, so that the name of the town does not appear as dark green like the label.

Sign up for free to 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.

2 participants