mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 02:55:46 +00:00
Add config option to block /pay from ignored users (#3273)
This commit is contained in:
parent
b9f8fc2e11
commit
fdef1062f0
4 changed files with 11 additions and 1 deletions
|
@ -280,6 +280,8 @@ public interface ISettings extends IConf {
|
||||||
|
|
||||||
BigDecimal getMinimumPayAmount();
|
BigDecimal getMinimumPayAmount();
|
||||||
|
|
||||||
|
boolean isPayExcludesIgnoreList();
|
||||||
|
|
||||||
long getLastMessageReplyRecipientTimeout();
|
long getLastMessageReplyRecipientTimeout();
|
||||||
|
|
||||||
boolean isMilkBucketEasterEggEnabled();
|
boolean isMilkBucketEasterEggEnabled();
|
||||||
|
|
|
@ -1258,6 +1258,11 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
return new BigDecimal(config.getString("minimum-pay-amount", "0.001"));
|
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() {
|
@Override public long getLastMessageReplyRecipientTimeout() {
|
||||||
return config.getLong("last-message-reply-recipient-timeout", 180);
|
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 {
|
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException {
|
||||||
User user = ess.getUser(sender.getPlayer());
|
User user = ess.getUser(sender.getPlayer());
|
||||||
try {
|
try {
|
||||||
if (!player.isAcceptingPay()) {
|
if (!player.isAcceptingPay() || (ess.getSettings().isPayExcludesIgnoreList() && player.isIgnoredPlayer(user))) {
|
||||||
sender.sendMessage(tl("notAcceptingPay", player.getDisplayName()));
|
sender.sendMessage(tl("notAcceptingPay", player.getDisplayName()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -702,6 +702,9 @@ economy-log-update-enabled: false
|
||||||
# Minimum acceptable amount to be used in /pay.
|
# Minimum acceptable amount to be used in /pay.
|
||||||
minimum-pay-amount: 0.001
|
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.
|
# The format of currency, excluding symbols. See currency-symbol-format-locale for symbol configuration.
|
||||||
#
|
#
|
||||||
# "#,##0.00" is how the majority of countries display currency.
|
# "#,##0.00" is how the majority of countries display currency.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue