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

View file

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

View file

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