Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requirements for balancetop listing #5394

Open
wants to merge 4 commits into
base: 2.x
Choose a base branch
from

Conversation

ayush03dev
Copy link

Information

This PR closes #5307

Details

Proposed feature:

This pull request adds two requirements that the player must meet in order for their name to appear in the balance top list. Those two requirements are: 1) Minimum Balance and 2) Minimum Playtime

The requirements can be configured from the following additions to config.yml file:

# Requirements which must be met by the player to get their name shown in the balance top list.
# Playtime is in seconds.
baltop-requirements:
  minimum-balance: 0
  minimum-playtime: 0

Environments tested:

OS: Ubuntu 23.04

Java version: 17

  • Most recent Paper version (1.20.1, git-Paper-17)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Before configuring balance requirement (set to 0)

image
image

After configuring balance requirement

image
image

As you can see the name disappears from the list because min-balance required was 500 but the player had 499.

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

You need to maintain backwards compatibility for the show-zero-baltop config option.

@ayush03dev
Copy link
Author

You need to maintain backwards compatibility for the show-zero-baltop config option.

I have re-added the above config option and made necessary checks along with the new options.

@ayush03dev ayush03dev requested a review from JRoy June 24, 2023 12:55
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.

Exclude Baltop if player doesnt meet minimum balance // baltop-min-balance
3 participants