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.

- 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

- Simplifies mctop placeholders
- Refactors mctop placeholders to use a single placeholder for both skill level/score and player name.
- This removes the need for separate "mctop" and "mctop_name" placeholders, improving usability and reducing code duplication.
- This import is necessary for handling potential exceptions related to invalid skill references within the PlaceholderAPI expansion.
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