Skip to content

Commit

Permalink
Log tax messages to the shop logger too
Browse files Browse the repository at this point in the history
This makes it possible to turn these messages off or reroute them to the shop log file
  • Loading branch information
Phoenix616 committed Oct 8, 2023
1 parent 53aa75d commit 2388da6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ public static void onCurrencyTransfer(CurrencyTransferEvent event) {
NameManager.getServerEconomyAccount().getUuid(),
event.getWorld()));
}
ChestShop.getBukkitLogger().info(String.format(TAX_RECEIVED_MESSAGE, taxAmount, tax, taxedAmount));
ChestShop.getShopLogger().info(String.format(TAX_RECEIVED_MESSAGE, taxAmount, tax, taxedAmount));
}
} else if (event.getDirection() == CurrencyTransferEvent.Direction.PARTNER && Permission.has(event.getInitiator(), Permission.NO_BUY_TAX)) {
// Reduce paid amount as the buyer has permission to not pay taxes
BigDecimal taxSent = getTaxAmount(event.getAmountSent(), taxAmount);
BigDecimal taxedSentAmount = event.getAmountSent().subtract(taxSent);
event.setAmountSent(taxedSentAmount);
ChestShop.getBukkitLogger().info(String.format(TAX_SENT_MESSAGE, taxAmount, taxSent, taxedSentAmount));
ChestShop.getShopLogger().info(String.format(TAX_SENT_MESSAGE, taxAmount, taxSent, taxedSentAmount));

// Reduce the amount that the seller receives anyways even though tax wasn't paid as that shouldn't make a difference for the seller
BigDecimal taxReceived = getTaxAmount(event.getAmountReceived(), taxAmount);
BigDecimal taxedReceivedAmount = event.getAmountReceived().subtract(taxReceived);
event.setAmountReceived(taxedReceivedAmount);
ChestShop.getBukkitLogger().info(String.format(TAX_RECEIVED_MESSAGE, taxAmount, taxReceived, taxedReceivedAmount));
ChestShop.getShopLogger().info(String.format(TAX_RECEIVED_MESSAGE, taxAmount, taxReceived, taxedReceivedAmount));
}
}
}
}

0 comments on commit 2388da6

Please sign in to comment.