Add %money% placeholder support for BossBar#1972
Open
NoltoxGit wants to merge 8 commits into
Open
Conversation
Contributor
Author
|
Hey @Zrips! The project compiles successfully without any errors, and the PR is now ready to be merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces the
%money%placeholder for the BossBar output, bringing its functionality closer to what is already available and well-handled in the ActionBar. Additionally, this PR fixes an edge case where the BossBar would not display at all if an action yielded only money but no experience (expGain == 0).Changes Made:
JobProgression.java: Added alastMoneyvariable (with getters and setters) to temporarily cache the money earned from an action before the BossBar updates, functioning identically to the existinglastExperiencevariable.Jobs.java: Updated theaction()andperform()methods so thatprog.setLastMoney()aggregates the money earned before firing theJobsInstancePaymentEventand the level-up checks.BossBarManager.java:ShowJobProgression(player)to checkif (oneJob.getLastExperience() != 0 || oneJob.getLastMoney() != 0). This ensures the BossBar still triggers for actions that only reward money and no XP.%money%placeholder in thecommand.stats.bossBarOutputmessage.LanguageManager.java& Locale files: Added the%money%placeholder to thebossBarOutputdefault string inLanguageManager.javaand updated all existingmessages_*.ymltranslation files to include it by default.Use Case:
Many server owners prefer to disable the ActionBar payment messages to avoid screen clutter and centralize all progression tracking (XP and Money) in the BossBar. Until now, there was no way to display the money earned directly on the BossBar.
Testing:
%money%correctly parses and displays the formatted amount.%money%is replaced with an empty string when the action yields no money.