Skip to content

Lazy initialization of formattedDisplayName#14039

Open
Dominilk01 wants to merge 1 commit into
PaperMC:mainfrom
Dominilk01:lazy-load-objective
Open

Lazy initialization of formattedDisplayName#14039
Dominilk01 wants to merge 1 commit into
PaperMC:mainfrom
Dominilk01:lazy-load-objective

Conversation

@Dominilk01

@Dominilk01 Dominilk01 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Objective#getFormattedDisplayName() is only used internally by vanilla commands ScoreboardCommand and TriggerCommand.
So its unnecessary to initialize with objective it if its if only a small part of Objective will ever use it.

@Dominilk01 Dominilk01 requested a review from a team as a code owner July 6, 2026 19:10
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jul 6, 2026
@Owen1212055

Copy link
Copy Markdown
Member

Is this fixing a bug or something? What exactly is the purpose of this rather than stopping the allocation of this?

@Dominilk01

Dominilk01 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

I made it cause for example in fastboard (a scoreboard libbrary that use nms packets with reflection) when you update title it create a new objective each time, so if you have an animated scoreboard it yust spend most of it time creating this Component

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

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants