Add config option to block /pay from ignored users (#3273)

This commit is contained in:
Josh Roy 2020-05-27 15:34:11 -04:00 committed by GitHub
parent b9f8fc2e11
commit fdef1062f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View File

@ -280,6 +280,8 @@ public interface ISettings extends IConf {
BigDecimal getMinimumPayAmount();
boolean isPayExcludesIgnoreList();
long getLastMessageReplyRecipientTimeout();
boolean isMilkBucketEasterEggEnabled();

View File

@ -1258,6 +1258,11 @@ public class Settings implements net.ess3.api.ISettings {
return new BigDecimal(config.getString("minimum-pay-amount", "0.001"));
}
@Override
public boolean isPayExcludesIgnoreList() {
return config.getBoolean("pay-excludes-ignore-list", false);
}
@Override public long getLastMessageReplyRecipientTimeout() {
return config.getLong("last-message-reply-recipient-timeout", 180);
}

View File

@ -59,7 +59,7 @@ public class Commandpay extends EssentialsLoopCommand {
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException {
User user = ess.getUser(sender.getPlayer());
try {
if (!player.isAcceptingPay()) {
if (!player.isAcceptingPay() || (ess.getSettings().isPayExcludesIgnoreList() && player.isIgnoredPlayer(user))) {
sender.sendMessage(tl("notAcceptingPay", player.getDisplayName()));
return;
}

View File

@ -702,6 +702,9 @@ economy-log-update-enabled: false
# Minimum acceptable amount to be used in /pay.
minimum-pay-amount: 0.001
# Enable this to block users who try to /pay another user which ignore them.
pay-excludes-ignore-list: false
# The format of currency, excluding symbols. See currency-symbol-format-locale for symbol configuration.
#
# "#,##0.00" is how the majority of countries display currency.