Do not charge taxes if player is buying from their own shop

This commit is contained in:
Kai committed 2016-05-27 11:09:45 +02:00
1 parent ec1fe83f18
commit 899eb70b84
1 file changed
+4
@@ -459,6 +459,10 @@ public class ShopManager {
// themselves.
// Do charge an amount of tax though.
double tax = plugin.getConfig().getDouble("tax");
if (shop.getOwner().equals(p.getUniqueId())) {
tax = 0;
}
double total = amount * shop.getPrice();
if (!plugin.getEcon().withdraw(p.getUniqueId(), total)) {
p.sendMessage(MsgUtil.getMessage("you-cant-afford-to-buy", format(amount * shop.getPrice()), format(plugin.getEcon().getBalance(p.getName()))));