Skip to content

Commit

Permalink
Fix paying tax bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tining123 committed Apr 17, 2022
1 parent fa82b12 commit 4130728
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/com/tining/demonmarket/command/UserCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
int time = (int)(totalValue / ConfigReader.getPayUnit());
double res = totalValue % ConfigReader.getPayUnit();

double price = MarketEconomy.getSellingPrice(ConfigReader.getPayUnit(), time, Vault.checkCurrency(player.getUniqueId()));
double price = MarketEconomy.getSellingPrice(ConfigReader.getPayUnit(), time, Vault.checkCurrency(reciever.getUniqueId()));
totalPrice += price;
Vault.subtractCurrency(player.getUniqueId(), ConfigReader.getPayUnit());
Vault.addVaultCurrency(reciever, price);

price = MarketEconomy.getSellingPrice(res, 1, Vault.checkCurrency(player.getUniqueId()));
price = MarketEconomy.getSellingPrice(res, 1, Vault.checkCurrency(reciever.getUniqueId()));
totalPrice += price;
Vault.subtractCurrency(player.getUniqueId(), res);
Vault.addVaultCurrency(reciever, price);
Vault.subtractCurrency(player.getUniqueId(), totalValue);
Vault.addVaultCurrency(reciever, totalPrice);

player.sendMessage(ChatColor.YELLOW + String.format(LangUtil.get("转账成功,花费%S,转账%s"), totalValue, totalPrice));
return true;
Expand Down

0 comments on commit 4130728

Please sign in to comment.