Updates README, renames paymentDelay

Renames paymentDelay to payoutDelay for consistency
Adds permission information to the README
Adds information about player time tracking to the README
This commit is contained in:
Kristian Knarvik 2024-01-09 11:58:12 +01:00
parent b91858ad2d
commit db922f7351
5 changed files with 25 additions and 13 deletions

View File

@ -11,6 +11,10 @@ The logic for which payout is used is as follows:
- If a payout is set for one or more of a player's group, the highest value will be used. - If a payout is set for one or more of a player's group, the highest value will be used.
- If none of the above apply, the base pay is used. - If none of the above apply, the base pay is used.
Once a second, any players that have played longer than the specified payout delay are paid, and their internally
tracked playtime is reset. This is an improvement over plugins that simply pay players on a set delay, as that just ends
up being a game of chance. If you are lucky, you are paid immediately after joining, which doesn't seem fair.
## Dependencies ## Dependencies
### Required ### Required
@ -57,8 +61,16 @@ This command is used to override the payout for a specific group.
| Option | Type | Description | | Option | Type | Description |
|-----------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------| |-----------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|
| defaultPayout | decimal number | The amount of currency to pay by default | | defaultPayout | decimal number | The amount of currency to pay by default |
| paymentDelay | number | The amount of minutes to wait between each payout | | payoutDelay | number | The amount of minutes to wait between each payout |
| displayPaymentMessage | true / false | Whether to display a message to the player each time a player receives a payout | | displayPaymentMessage | true / false | Whether to display a message to the player each time a player receives a payout |
| hoursUntilBonus | number / -1 | The amount of hours a player must play until they start receiving a payout bonus, or -1 to disable the feature | | hoursUntilBonus | number / -1 | The amount of hours a player must play until they start receiving a payout bonus, or -1 to disable the feature |
| bonusMultiplier | decimal number | A multiplier used to increase or decrease the time bonus ((hours played / hours until bonus) * bonusMultiplier) + payout | | bonusMultiplier | decimal number | A multiplier used to increase or decrease the time bonus ((hours played / hours until bonus) * bonusMultiplier) + payout |
| afkPercentage | percentage (0-100) | The percentage of their normal payout to pay AFK players | | afkPercentage | percentage (0-100) | The percentage of their normal payout to pay AFK players |
## Permissions
| Permission | Description |
|--------------------|----------------------------------------|
| timeismoney.* | Grants all permissions |
| timeismoney.reload | Allows usage of the reload command |
| timeismoney.admin | Allows usage of configuration commands |

View File

@ -128,7 +128,7 @@ public final class PlayerPayouts extends JavaPlugin {
if (lastPaid == null) { if (lastPaid == null) {
continue; continue;
} }
if ((System.currentTimeMillis() - lastPaid) / 60000 < configuration.getPaymentDelay()) { if ((System.currentTimeMillis() - lastPaid) / 60000 < configuration.getPayoutDelay()) {
continue; continue;
} }

View File

@ -24,7 +24,7 @@ public class Configuration {
private final double defaultPayout; private final double defaultPayout;
private final int hoursUntilBonus; private final int hoursUntilBonus;
private final double bonusMultiplier; private final double bonusMultiplier;
private final int paymentDelay; private final int payoutDelay;
private final double afkPercentage; private final double afkPercentage;
private final boolean displayPaymentMessage; private final boolean displayPaymentMessage;
@ -54,7 +54,7 @@ public class Configuration {
this.defaultPayout = fileConfiguration.getDouble(ConfigurationKey.DEFAULT_PAYOUT.getPath(), 10); this.defaultPayout = fileConfiguration.getDouble(ConfigurationKey.DEFAULT_PAYOUT.getPath(), 10);
this.hoursUntilBonus = fileConfiguration.getInt(ConfigurationKey.HOURS_UNTIL_BONUS.getPath(), 100); this.hoursUntilBonus = fileConfiguration.getInt(ConfigurationKey.HOURS_UNTIL_BONUS.getPath(), 100);
this.bonusMultiplier = fileConfiguration.getDouble(ConfigurationKey.BONUS_MULTIPLIER.getPath(), 1); this.bonusMultiplier = fileConfiguration.getDouble(ConfigurationKey.BONUS_MULTIPLIER.getPath(), 1);
this.paymentDelay = fileConfiguration.getInt(ConfigurationKey.PAYMENT_DELAY.getPath(), 60); this.payoutDelay = fileConfiguration.getInt(ConfigurationKey.PAYOUT_DELAY.getPath(), 60);
this.afkPercentage = fileConfiguration.getDouble(ConfigurationKey.AFK_PERCENTAGE.getPath(), 0); this.afkPercentage = fileConfiguration.getDouble(ConfigurationKey.AFK_PERCENTAGE.getPath(), 0);
this.displayPaymentMessage = fileConfiguration.getBoolean(ConfigurationKey.DISPLAY_PAYMENT_MESSAGE.getPath(), true); this.displayPaymentMessage = fileConfiguration.getBoolean(ConfigurationKey.DISPLAY_PAYMENT_MESSAGE.getPath(), true);
} }
@ -128,8 +128,8 @@ public class Configuration {
* *
* @return <p>The delay between payments</p> * @return <p>The delay between payments</p>
*/ */
public int getPaymentDelay() { public int getPayoutDelay() {
return paymentDelay; return payoutDelay;
} }
/** /**
@ -182,8 +182,8 @@ public class Configuration {
* Saves this configuration to disk * Saves this configuration to disk
*/ */
public void save() { public void save() {
fileConfiguration.set(ConfigurationKey.PAYMENT_DELAY.getPath(), this.paymentDelay); fileConfiguration.set(ConfigurationKey.PAYOUT_DELAY.getPath(), this.payoutDelay);
fileConfiguration.setComments(ConfigurationKey.PAYMENT_DELAY.getPath(), fileConfiguration.setComments(ConfigurationKey.PAYOUT_DELAY.getPath(),
List.of("The amount of minutes to wait between each payment")); List.of("The amount of minutes to wait between each payment"));
fileConfiguration.set(ConfigurationKey.BONUS_MULTIPLIER.getPath(), this.bonusMultiplier); fileConfiguration.set(ConfigurationKey.BONUS_MULTIPLIER.getPath(), this.bonusMultiplier);
@ -202,8 +202,8 @@ public class Configuration {
fileConfiguration.setComments(ConfigurationKey.AFK_PERCENTAGE.getPath(), fileConfiguration.setComments(ConfigurationKey.AFK_PERCENTAGE.getPath(),
List.of("The percentage of their normal payout to pay AFK players")); List.of("The percentage of their normal payout to pay AFK players"));
fileConfiguration.set(ConfigurationKey.PAYMENT_DELAY.getPath(), this.paymentDelay); fileConfiguration.set(ConfigurationKey.PAYOUT_DELAY.getPath(), this.payoutDelay);
fileConfiguration.setComments(ConfigurationKey.PAYMENT_DELAY.getPath(), fileConfiguration.setComments(ConfigurationKey.PAYOUT_DELAY.getPath(),
List.of("The amount of minutes to wait between each payment")); List.of("The amount of minutes to wait between each payment"));
fileConfiguration.set(ConfigurationKey.HOURS_UNTIL_BONUS.getPath(), this.hoursUntilBonus); fileConfiguration.set(ConfigurationKey.HOURS_UNTIL_BONUS.getPath(), this.hoursUntilBonus);

View File

@ -22,7 +22,7 @@ public enum ConfigurationKey {
/** /**
* The amount of minutes between each payout * The amount of minutes between each payout
*/ */
PAYMENT_DELAY("paymentDelay"), PAYOUT_DELAY("payoutDelay"),
/** /**
* The percentage of the payment to pay AFK players * The percentage of the payment to pay AFK players

View File

@ -1,7 +1,7 @@
# The default payout if the player has no overrides # The default payout if the player has no overrides
defaultPayout: 10 defaultPayout: 10
# The amount of minutes to wait between each payment # The amount of minutes to wait between each payout
paymentDelay: 60 payoutDelay: 60
# Whether to announce to a player that they've just been paid # Whether to announce to a player that they've just been paid
displayPaymentMessage: true displayPaymentMessage: true
# The amount of hours until a bonus is given. Set to -1 to disable. # The amount of hours until a bonus is given. Set to -1 to disable.