From 1838354b70891ab48a12481aebf3fbfd0890b302 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 1 Jan 2021 23:12:53 -0600 Subject: [PATCH] Add ending user balance as a final field in trade.log (#3721) Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com> --- .../java/com/earth2me/essentials/Trade.java | 9 ++++++++- .../java/com/earth2me/essentials/User.java | 2 +- .../com/earth2me/essentials/api/Economy.java | 16 ++++++++-------- .../essentials/commands/Commandpay.java | 2 +- .../essentials/commands/Commandsell.java | 2 +- .../com/earth2me/essentials/signs/SignBuy.java | 2 +- .../earth2me/essentials/signs/SignEnchant.java | 2 +- .../earth2me/essentials/signs/SignFree.java | 2 +- .../essentials/signs/SignGameMode.java | 2 +- .../earth2me/essentials/signs/SignHeal.java | 2 +- .../earth2me/essentials/signs/SignInfo.java | 2 +- .../com/earth2me/essentials/signs/SignKit.java | 2 +- .../earth2me/essentials/signs/SignRepair.java | 2 +- .../earth2me/essentials/signs/SignSell.java | 2 +- .../essentials/signs/SignSpawnmob.java | 2 +- .../earth2me/essentials/signs/SignTime.java | 4 ++-- .../earth2me/essentials/signs/SignTrade.java | 18 +++++++++--------- .../earth2me/essentials/signs/SignWarp.java | 2 +- .../earth2me/essentials/signs/SignWeather.java | 4 ++-- 19 files changed, 43 insertions(+), 36 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/Trade.java b/Essentials/src/main/java/com/earth2me/essentials/Trade.java index 34779982f..94da5c9f2 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/Trade.java +++ b/Essentials/src/main/java/com/earth2me/essentials/Trade.java @@ -68,7 +68,7 @@ public class Trade { this.ess = ess; } - public static void log(final String type, final String subtype, final String event, final String sender, final Trade charge, final String receiver, final Trade pay, final Location loc, final IEssentials ess) { + public static void log(final String type, final String subtype, final String event, final String sender, final Trade charge, final String receiver, final Trade pay, final Location loc, final BigDecimal endBalance, final IEssentials ess) { //isEcoLogUpdateEnabled() - This refers to log entries with no location, ie API updates #EasterEgg //isEcoLogEnabled() - This refers to log entries with with location, ie /pay /sell and eco signs. @@ -142,6 +142,13 @@ public class Trade { sb.append(loc.getBlockY()).append(","); sb.append(loc.getBlockZ()).append(","); } + + if (endBalance == null) { + sb.append(","); + } else { + sb.append(endBalance); + sb.append(","); + } sb.append("\n"); try { fw.write(sb.toString()); diff --git a/Essentials/src/main/java/com/earth2me/essentials/User.java b/Essentials/src/main/java/com/earth2me/essentials/User.java index 83ba35ba4..905f4a420 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/User.java +++ b/Essentials/src/main/java/com/earth2me/essentials/User.java @@ -507,7 +507,7 @@ public class User extends UserData implements Comparable, IMessageRecipien } } super.setMoney(newBalance, true); - Trade.log("Update", "Set", "API", getName(), new Trade(newBalance, ess), null, null, null, ess); + Trade.log("Update", "Set", "API", getName(), new Trade(newBalance, ess), null, null, null, newBalance, ess); } public void updateMoneyCache(final BigDecimal value) { diff --git a/Essentials/src/main/java/com/earth2me/essentials/api/Economy.java b/Essentials/src/main/java/com/earth2me/essentials/api/Economy.java index 29780d5cb..37b630895 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/main/java/com/earth2me/essentials/api/Economy.java @@ -234,7 +234,7 @@ public class Economy { } catch (final MaxMoneyException ex) { //TODO: Update API to show max balance errors } - Trade.log("API", "Set", "API", user.getName(), new Trade(balance, ess), null, null, null, ess); + Trade.log("API", "Set", "API", user.getName(), new Trade(balance, ess), null, null, null, balance, ess); } /** @@ -307,7 +307,7 @@ public class Economy { } final BigDecimal result = getMoneyExact(user).add(amount, MATH_CONTEXT); setMoney(user, result); - Trade.log("API", "Add", "API", user.getName(), new Trade(amount, ess), null, null, null, ess); + Trade.log("API", "Add", "API", user.getName(), new Trade(amount, ess), null, null, null, result, ess); } /** @@ -342,7 +342,7 @@ public class Economy { public static void substract(final String name, final BigDecimal amount) throws UserDoesNotExistException, NoLoanPermittedException, ArithmeticException { final BigDecimal result = getMoneyExact(name).subtract(amount, MATH_CONTEXT); setMoney(name, result); - Trade.log("API", "Subtract", "API", name, new Trade(amount, ess), null, null, null, ess); + Trade.log("API", "Subtract", "API", name, new Trade(amount, ess), null, null, null, result, ess); } /** @@ -376,7 +376,7 @@ public class Economy { } final BigDecimal result = getMoneyExact(user).subtract(amount, MATH_CONTEXT); setMoney(user, result); - Trade.log("API", "Subtract", "API", user.getName(), new Trade(amount, ess), null, null, null, ess); + Trade.log("API", "Subtract", "API", user.getName(), new Trade(amount, ess), null, null, null, result, ess); } /** @@ -447,7 +447,7 @@ public class Economy { } final BigDecimal result = getMoneyExact(user).divide(amount, MATH_CONTEXT); setMoney(user, result); - Trade.log("API", "Divide", "API", user.getName(), new Trade(amount, ess), null, null, null, ess); + Trade.log("API", "Divide", "API", user.getName(), new Trade(amount, ess), null, null, null, result, ess); } /** @@ -518,7 +518,7 @@ public class Economy { } final BigDecimal result = getMoneyExact(user).multiply(amount, MATH_CONTEXT); setMoney(user, result); - Trade.log("API", "Multiply", "API", user.getName(), new Trade(amount, ess), null, null, null, ess); + Trade.log("API", "Multiply", "API", user.getName(), new Trade(amount, ess), null, null, null, result, ess); } /** @@ -535,7 +535,7 @@ public class Economy { throw new RuntimeException(noCallBeforeLoad); } setMoney(name, ess.getSettings().getStartingBalance()); - Trade.log("API", "Reset", "API", name, new Trade(BigDecimal.ZERO, ess), null, null, null, ess); + Trade.log("API", "Reset", "API", name, new Trade(BigDecimal.ZERO, ess), null, null, null, ess.getSettings().getStartingBalance(), ess); } /** @@ -567,7 +567,7 @@ public class Economy { throw new IllegalArgumentException("Economy user cannot be null"); } setMoney(user, ess.getSettings().getStartingBalance()); - Trade.log("API", "Reset", "API", user.getName(), new Trade(BigDecimal.ZERO, ess), null, null, null, ess); + Trade.log("API", "Reset", "API", user.getName(), new Trade(BigDecimal.ZERO, ess), null, null, null, ess.getSettings().getStartingBalance(), ess); } /** diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java index da60f1756..be83eefec 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java @@ -62,7 +62,7 @@ public class Commandpay extends EssentialsLoopCommand { } user.payUser(player, amount, UserBalanceUpdateEvent.Cause.COMMAND_PAY); user.getConfirmingPayments().remove(player); - Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess); + Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), user.getMoney(), ess); } catch (final MaxMoneyException ex) { user.sendMessage(tl("maxMoney")); try { diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandsell.java index f7865d185..1a153c039 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandsell.java @@ -114,7 +114,7 @@ public class Commandsell extends EssentialsCommand { } user.getBase().getInventory().removeItem(ris); user.getBase().updateInventory(); - Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), ess); + Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), user.getMoney(), ess); user.giveMoney(result, null, UserBalanceUpdateEvent.Cause.COMMAND_SELL); user.sendMessage(tl("itemSold", NumberUtil.displayCurrency(result, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess))); logger.log(Level.INFO, tl("itemSoldConsole", user.getName(), is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(result, ess), amount, NumberUtil.displayCurrency(worth, ess), user.getDisplayName())); diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignBuy.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignBuy.java index e347fb092..76ca2045b 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignBuy.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignBuy.java @@ -49,7 +49,7 @@ public class SignBuy extends EssentialsSign { throw new ChargeException("Inventory full"); //TODO: TL } charge.charge(player); - Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignEnchant.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignEnchant.java index 9ac87aca5..f308b6119 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignEnchant.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignEnchant.java @@ -110,7 +110,7 @@ public class SignEnchant extends EssentialsSign { } charge.charge(player); - Trade.log("Sign", "Enchant", "Interact", username, charge, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Enchant", "Interact", username, charge, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); player.getBase().updateInventory(); return true; } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignFree.java index 70d31625b..d92f4aed5 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignFree.java @@ -49,7 +49,7 @@ public class SignFree extends EssentialsSign { invent.addItem(item); } player.getBase().openInventory(invent); - Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignGameMode.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignGameMode.java index 703fd6258..a58a32de2 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignGameMode.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignGameMode.java @@ -41,7 +41,7 @@ public class SignGameMode extends EssentialsSign { performSetMode(mode.toLowerCase(Locale.ENGLISH), player.getBase()); player.sendMessage(tl("gameMode", tl(player.getBase().getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); - Trade.log("Sign", "gameMode", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "gameMode", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); charge.charge(player); return true; } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignHeal.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignHeal.java index 23c38708c..dfddd55f5 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignHeal.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignHeal.java @@ -30,7 +30,7 @@ public class SignHeal extends EssentialsSign { player.getBase().setFireTicks(0); player.sendMessage(tl("youAreHealed")); charge.charge(player); - Trade.log("Sign", "Heal", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Heal", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignInfo.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignInfo.java index 82e144385..cd618aca3 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignInfo.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignInfo.java @@ -43,7 +43,7 @@ public class SignInfo extends EssentialsSign { } charge.charge(player); - Trade.log("Sign", "Info", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Info", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignKit.java index b122a8713..cb5498b39 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignKit.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignKit.java @@ -53,7 +53,7 @@ public class SignKit extends EssentialsSign { kit.expandItems(player); charge.charge(player); - Trade.log("Sign", "Kit", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Kit", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); } catch (final NoChargeException ex) { return false; } catch (final Exception ex) { diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignRepair.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignRepair.java index f4c81071c..397a8de3c 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignRepair.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignRepair.java @@ -49,7 +49,7 @@ public class SignRepair extends EssentialsSign { } charge.charge(player); - Trade.log("Sign", "Repair", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Repair", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignSell.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignSell.java index fa2941823..1e1079f25 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignSell.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignSell.java @@ -48,7 +48,7 @@ public class SignSell extends EssentialsSign { charge.isAffordableFor(player); money.pay(player, OverflowType.DROP); charge.charge(player); - Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignSpawnmob.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignSpawnmob.java index dc8978940..71eaf8042 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignSpawnmob.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignSpawnmob.java @@ -34,7 +34,7 @@ public class SignSpawnmob extends EssentialsSign { } charge.charge(player); - Trade.log("Sign", "Spawnmob", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Spawnmob", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } } diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTime.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTime.java index 76de1e188..a8ad191e1 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTime.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTime.java @@ -37,13 +37,13 @@ public class SignTime extends EssentialsSign { if ("§2Day".equalsIgnoreCase(timeString)) { player.getWorld().setTime(time + 24000); charge.charge(player); - Trade.log("Sign", "TimeDay", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "TimeDay", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } if ("§2Night".equalsIgnoreCase(timeString)) { player.getWorld().setTime(time + 37700); charge.charge(player); - Trade.log("Sign", "TimeNight", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "TimeNight", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } throw new SignException(tl("onlyDayNight")); diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java index c2c9f03e7..7f6aeeef6 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java @@ -34,7 +34,7 @@ public class SignTrade extends EssentialsSign { trade.isAffordableFor(player); sign.setLine(3, "§8" + username); trade.charge(player); - Trade.log("Sign", "Trade", "Create", username, trade, username, null, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Create", username, trade, username, null, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } @@ -50,17 +50,17 @@ public class SignTrade extends EssentialsSign { final Map withdraw = stored.pay(player, OverflowType.RETURN); if (withdraw == null) { - Trade.log("Sign", "Trade", "Withdraw", username, store, username, null, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Withdraw", username, store, username, null, sign.getBlock().getLocation(), player.getMoney(), ess); } else { setAmount(sign, 1, BigDecimal.valueOf(withdraw.get(0).getAmount()), ess); - Trade.log("Sign", "Trade", "Withdraw", username, stored, username, new Trade(withdraw.get(0), ess), sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Withdraw", username, stored, username, new Trade(withdraw.get(0), ess), sign.getBlock().getLocation(), player.getMoney(), ess); } } catch (final SignException e) { if (store == null) { throw new SignException(tl("tradeSignEmptyOwner"), e); } } - Trade.log("Sign", "Trade", "Deposit", username, store, username, null, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Deposit", username, store, username, null, sign.getBlock().getLocation(), player.getMoney(), ess); } else { final Trade charge = getTrade(sign, 1, AmountType.COST, false, true, ess); final Trade trade = getTrade(sign, 2, AmountType.COST, true, true, ess); @@ -73,7 +73,7 @@ public class SignTrade extends EssentialsSign { throw new ChargeException("Full inventory"); } charge.charge(player); - Trade.log("Sign", "Trade", "Interact", sign.getLine(3).substring(2), charge, username, trade, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Interact", sign.getLine(3).substring(2), charge, username, trade, sign.getBlock().getLocation(), player.getMoney(), ess); } sign.updateSign(); return true; @@ -110,7 +110,7 @@ public class SignTrade extends EssentialsSign { final Trade stored2 = getTrade(sign, 2, AmountType.TOTAL, false, true, ess); if (!canCollect) { - Trade.log("Sign", "Trade", "Destroy", signOwner.substring(2), stored2, username, stored1, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Destroy", signOwner.substring(2), stored2, username, stored1, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } @@ -118,15 +118,15 @@ public class SignTrade extends EssentialsSign { final Map withdraw2 = stored2.pay(player, OverflowType.RETURN); if (withdraw1 == null && withdraw2 == null) { - Trade.log("Sign", "Trade", "Break", signOwner.substring(2), stored2, username, stored1, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Break", signOwner.substring(2), stored2, username, stored1, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } setAmount(sign, 1, BigDecimal.valueOf(withdraw1 == null ? 0L : withdraw1.get(0).getAmount()), ess); - Trade.log("Sign", "Trade", "Withdraw", signOwner.substring(2), stored1, username, withdraw1 == null ? null : new Trade(withdraw1.get(0), ess), sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Withdraw", signOwner.substring(2), stored1, username, withdraw1 == null ? null : new Trade(withdraw1.get(0), ess), sign.getBlock().getLocation(), player.getMoney(), ess); setAmount(sign, 2, BigDecimal.valueOf(withdraw2 == null ? 0L : withdraw2.get(0).getAmount()), ess); - Trade.log("Sign", "Trade", "Withdraw", signOwner.substring(2), stored2, username, withdraw2 == null ? null : new Trade(withdraw2.get(0), ess), sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Trade", "Withdraw", signOwner.substring(2), stored2, username, withdraw2 == null ? null : new Trade(withdraw2.get(0), ess), sign.getBlock().getLocation(), player.getMoney(), ess); sign.updateSign(); } catch (final SignException e) { diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignWarp.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignWarp.java index 121fd19c0..964c5c28c 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignWarp.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignWarp.java @@ -57,7 +57,7 @@ public class SignWarp extends EssentialsSign { player.getAsyncTeleport().warp(player, warpName, charge, TeleportCause.PLUGIN, future); future.thenAccept(success -> { if (success) { - Trade.log("Sign", "Warp", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "Warp", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); } }); future.exceptionally(e -> { diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignWeather.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignWeather.java index 4fc2a758e..e26eeb86e 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignWeather.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignWeather.java @@ -36,13 +36,13 @@ public class SignWeather extends EssentialsSign { if ("§2Sun".equalsIgnoreCase(weatherString)) { player.getWorld().setStorm(false); charge.charge(player); - Trade.log("Sign", "WeatherSun", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "WeatherSun", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } if ("§2Storm".equalsIgnoreCase(weatherString)) { player.getWorld().setStorm(true); charge.charge(player); - Trade.log("Sign", "WeatherStorm", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); + Trade.log("Sign", "WeatherStorm", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess); return true; } throw new SignException(tl("onlySunStorm"));