Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Add requirements for balancetop listing

Open ayush03dev opened this issue 2 years ago • 1 comments

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

  • [x] 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.

ayush03dev avatar Jun 16 '23 03:06 ayush03dev

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 avatar Jun 17 '23 02:06 ayush03dev