Skip to content

Conversation

@hudsonandres
Copy link

  • Adds placeholders to display mcMMO leaderboard information through PlaceholderAPI.

  • %mcmmo_mctop_<skill>:<position>%

  • %mcmmo_mctop_overall:<position>%

  • %mcmmo_mctop_name_<skill>:<position>%

  • %mcmmo_mctop_name_overall:<position>%

  • %mcmmo_checklevel_<skill>:<level>%

  • Added a new explanatory file PLACEHOLDERS.md detailing all the placeholders that can be used.

Copy link
Member

@nossr50 nossr50 left a comment

Choose a reason for hiding this comment

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

Looks like some stuff was included by accident that should be removed.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds leaderboard support to PlaceholderAPI, enabling server administrators to display mcMMO ranking information through placeholders in menus, scoreboards, and other UI elements.

  • Implements five new placeholder types for leaderboard queries and level checks
  • Adds comprehensive documentation file PLACEHOLDERS.md with usage examples
  • Updates visibility of init() method from protected to private

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/main/java/com/gmail/nossr50/placeholders/PapiExpansion.java Adds getLeaderboard() helper method, registers new placeholder types, and changes init() visibility to private
src/main/java/com/gmail/nossr50/placeholders/OverallRankPlaceholder.java New placeholder for displaying player's overall power level rank
src/main/java/com/gmail/nossr50/placeholders/McTopPositionPlaceholder.java New placeholder for retrieving player name or level at specific leaderboard positions
src/main/java/com/gmail/nossr50/placeholders/CheckLevelPlaceholder.java New placeholder for checking if player meets minimum skill level requirements
src/main/java/com/gmail/nossr50/listeners/BlockListener.java Unrelated change: Modifies Fortune enchantment handling for block drops - should be in separate PR
PLACEHOLDERS.md New documentation file detailing all available placeholders with examples and usage patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nossr50
Copy link
Member

nossr50 commented Nov 30, 2025

  • Unit tests would probably be a good idea, you can mock up the responses from the DatabaseManager(s) and just validate the business logic here

@nossr50
Copy link
Member

nossr50 commented Dec 13, 2025

Just an update, been a bit busy irl this time of year, will be reviewing again soon, but this is likely to come in after the spears update.

@Chew
Copy link
Member

Chew commented Dec 13, 2025

By the way, I think the PLACEHOLDERS.md file might be better on the wiki repo here: https://github.com/mcMMO-Dev/mcmmo-wiki-repo/blob/master/placeholders.md. Excellent work on it!

@SrBedrock
Copy link
Contributor

Why is a colon (:) used to separate the position instead of an underscore (_), which is the commonly adopted standard for placeholders in general?

@hudsonandres
Copy link
Author

Why is a colon (:) used to separate the position instead of an underscore (_), which is the commonly adopted standard for placeholders in general?

I only kept the position structure from the original standard. PapiExpansion has a line for that: int dataPosition = params.indexOf(":");, however, it can be changed to underscore without any problem; a few adjustments are all that's needed to make it work.

@nossr50
Copy link
Member

nossr50 commented Dec 20, 2025

@hudsonandres if you add sufficient unit tests (preferably in Junit 5) I'd probably feel comfortable merging this, otherwise it's probably going to need to go into a dev branch when I find time to add them myself and then merge it into master later on, which would definitely slow down how quickly this feature would become available to others. Regarding the unit tests, feel free to mock up the responses and behavior from the DB classes as needed.

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.

Feature request: Placeholder of the leaderboard.

4 participants