mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-14 15:49:13 +01:00
Add config option to block /pay from ignored users (#3273)
This commit is contained in:
parent
b9f8fc2e11
commit
fdef1062f0
@ -280,6 +280,8 @@ public interface ISettings extends IConf {
|
||||
|
||||
BigDecimal getMinimumPayAmount();
|
||||
|
||||
boolean isPayExcludesIgnoreList();
|
||||
|
||||
long getLastMessageReplyRecipientTimeout();
|
||||
|
||||
boolean isMilkBucketEasterEggEnabled();
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user