Skip to content

Commit

Permalink
Remove debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl committed Oct 26, 2024
1 parent 165cee2 commit 0ea615a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class TownyEconomyHandler {
private static EconomyAdapter economy = null;
private static EconomyProvider provider = null;
private static String version = "";

private static final Executor ECONOMY_EXECUTOR = runnable -> {
if (TownySettings.isEconomyAsync() && plugin.getScheduler().isTickThread())
plugin.getScheduler().runAsync(runnable);
Expand Down Expand Up @@ -281,12 +281,11 @@ public static boolean subtract(String accountName, double amount, World world) {
* @return true if successful
*/
public static boolean subtract(Account account, double amount) {
System.out.println("TownyEconomyHandler#subtract 1");

if (!runPreChecks(Transaction.subtract(amount).paidBy(account).build())) {
System.out.println("TownyEconomyHandler#subtract 2");
return false;
}
System.out.println("TownyEconomyHandler#subtract 3");

return economy.subtract(account, amount);
}

Expand Down Expand Up @@ -316,7 +315,6 @@ public static boolean add(Account account, double amount) {
return false;
}

System.out.println("TownyEconomyHandler#add " + account.getName());
return economy.add(account, amount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ public void renameTown(Town town, String newName) throws AlreadyRegisteredExcept
}
}


UUID oldUUID = town.getUUID();
long oldregistration = town.getRegistered();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ protected synchronized boolean addMoney(double amount) {

@Override
protected synchronized boolean subtractMoney(double amount) {
System.out.println("EconomyAccount#subtractMoney 1");
return TownyEconomyHandler.subtract(this, amount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,9 @@ public final synchronized void depositToBank(Resident resident, int amount) thro
if (!TownyEconomyHandler.isActive()) {
throw new TownyException(Translation.of("msg_err_no_economy"));
}

System.out.println("Government#depositToBank 1");
if (!resident.getAccount().payTo(amount, this, "Deposit from " + resident.getName())) {
throw new TownyException(Translation.of("msg_insuf_funds"));
}
System.out.println("Government#depositToBank 1");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public synchronized boolean withdraw(double amount, String reason) {
return payToServer(amount, reason);

BukkitTools.fireEvent(Transaction.subtract(amount).paidBy(this).asTownyTransactionEvent());
System.out.println("Account#withdraw 1");
return true;
}

Expand Down Expand Up @@ -186,12 +185,11 @@ protected synchronized boolean payFromServer(double amount, String reason) {
* @return boolean indicating success.
*/
public synchronized boolean payTo(double amount, Account collector, String reason) {
System.out.println("Account#payTo 1");

if (amount > getHoldingBalance()) {
System.out.println("Account#payTo 2");
return false;
}
System.out.println("Account#payTo 3");

boolean success = withdraw(amount, reason) && collector.deposit(amount, reason);
if (success)
BukkitTools.fireEvent(Transaction.add(amount).paidBy(this).paidTo(collector).asTownyTransactionEvent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ protected synchronized boolean addMoney(double amount) {
if (isBankrupt())
return removeDebt(amount);

System.out.println("BankAccount#addMoney 1");
// Otherwise continue like normal.
return TownyEconomyHandler.add(this, amount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ public static void townWithdraw(Player player, Resident resident, Town town, int
public static void townDeposit(Player player, Resident resident, Town town, Nation nation, int amount) {

try {
System.out.println("MoneyUtil#townDeposit 1");
commonTests(amount, resident, town, player.getLocation(), false, false);
System.out.println("MoneyUtil#townDeposit 2");

Transaction transaction = Transaction.deposit(amount).paidBy(resident).paidTo(town).build();

BukkitTools.ifCancelledThenThrow(new TownPreTransactionEvent(town, transaction));
Expand Down Expand Up @@ -160,10 +159,9 @@ private static void commonTests(int amount, Resident resident, Town town, Locati
if (amount < 0)
throw new TownyException(Translatable.of("msg_err_negative_money"));

System.out.println("MoneyUtil#commonTests 1");
if (!withdraw && !resident.getAccount().canPayFromHoldings(amount))
throw new TownyException(Translatable.of("msg_insuf_funds"));
System.out.println("MoneyUtil#commonTests 2");

if (!nation && town.isRuined())
throw new TownyException(Translatable.of("msg_err_cannot_use_command_because_town_ruined"));

Expand Down

0 comments on commit 0ea615a

Please sign in to comment.