Add a verbose flag

This commit is contained in:
zontreck 2025-03-20 12:16:02 -07:00
parent fd73d47d3a
commit 4cdb0f48c0
3 changed files with 10 additions and 2 deletions

View file

@ -30,6 +30,7 @@ public class AutoMoneyPlugin extends JavaPlugin {
Configuration.g_dPaymentAmount = getConfig().getDouble("amountToGive", 0.25);
Configuration.g_iPaymentInterval = getConfig().getInt("duration", 60);
Configuration.g_sBankAccount = getConfig().getString("bank", "");
Configuration.g_bVerbose = getConfig().getBoolean("verbose", false);
// Setup the economy
if (!setupEconomy()) {
@ -62,6 +63,9 @@ public class AutoMoneyPlugin extends JavaPlugin {
@Override
public void run() {
if(Configuration.PaymentEnabled()) {
if(Configuration.g_bVerbose) {
getLogger().info("Paying all online players " + Configuration.g_dPaymentAmount);
}
// Pay all online players
getServer().getOnlinePlayers().forEach(player -> {
//player.sendMessage("You have been paid " + Configuration.g_dPaymentAmount + " for being online.");

View file

@ -4,7 +4,8 @@ public class Configuration {
public static double g_dPaymentAmount = 0.0;
public static int g_iPaymentInterval = 0;
public static String g_sBankAccount = "";
public static boolean g_bVerbose = false;
public static boolean PaymentEnabled() {
return g_iPaymentInterval > 0;

View file

@ -5,4 +5,7 @@ amountToGive: 0.25
duration: 60
# Bank account if applicable. Leave blank if undesired.
bank: ""
bank: ""
# Whether to print a log message in console every payout
verbose: false