mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-27 14:13:05 +02:00
Log tax messages to the shop logger too
This makes it possible to turn these messages off or reroute them to the shop log file
This commit is contained in:
parent
53aa75d9b4
commit
2388da62a5
@ -57,20 +57,20 @@ public class TaxModule implements Listener {
|
|||||||
NameManager.getServerEconomyAccount().getUuid(),
|
NameManager.getServerEconomyAccount().getUuid(),
|
||||||
event.getWorld()));
|
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)) {
|
} 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
|
// Reduce paid amount as the buyer has permission to not pay taxes
|
||||||
BigDecimal taxSent = getTaxAmount(event.getAmountSent(), taxAmount);
|
BigDecimal taxSent = getTaxAmount(event.getAmountSent(), taxAmount);
|
||||||
BigDecimal taxedSentAmount = event.getAmountSent().subtract(taxSent);
|
BigDecimal taxedSentAmount = event.getAmountSent().subtract(taxSent);
|
||||||
event.setAmountSent(taxedSentAmount);
|
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
|
// 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 taxReceived = getTaxAmount(event.getAmountReceived(), taxAmount);
|
||||||
BigDecimal taxedReceivedAmount = event.getAmountReceived().subtract(taxReceived);
|
BigDecimal taxedReceivedAmount = event.getAmountReceived().subtract(taxReceived);
|
||||||
event.setAmountReceived(taxedReceivedAmount);
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user