diff options
6 files changed, 22 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 0be445032..4c5a148cc 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -8,6 +8,7 @@ import java.util.Date; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import org.bukkit.Location; import org.bukkit.inventory.ItemStack; @@ -131,7 +132,7 @@ public class Trade } private static FileWriter fw = null; - public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, IEssentials ess) + public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess) { if (!ess.getSettings().isEcoLogEnabled()) { @@ -201,6 +202,18 @@ public class Trade sb.append(ess.getSettings().getCurrencySymbol()); } } + if (loc == null) + { + sb.append(",\"\",\"\",\"\",\"\""); + } + else + { + sb.append(",\""); + sb.append(loc.getWorld().getName()).append("\","); + sb.append(loc.getBlockX()).append(","); + sb.append(loc.getBlockY()).append(","); + sb.append(loc.getBlockZ()).append(","); + } sb.append("\n"); try { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 66b838051..56f6cb2fc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -153,7 +153,7 @@ public class Commandsell extends EssentialsCommand final ItemStack ris = new ItemStack(is.getType(), amount, is.getDurability()); InventoryWorkaround.removeItem(user.getInventory(), true, ris); user.updateInventory(); - Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth*amount, ess), ess); + Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth*amount, ess), user.getLocation(), ess); user.giveMoney(worth * amount); user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess))); logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess))); diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBuy.java b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java index 4249342e1..6ee602ff5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBuy.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java @@ -29,7 +29,7 @@ public class SignBuy extends EssentialsSign charge.isAffordableFor(player); items.pay(player); charge.charge(player); - Trade.log("Sign", "Buy", "Interact", username, charge, username, items, ess); + Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 55ea1d241..8939f4bea 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -32,7 +32,7 @@ public class SignFree extends EssentialsSign inv.clear(); InventoryWorkaround.addItem(inv, true, item); player.showInventory(inv); - Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), ess); + Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignSell.java b/Essentials/src/com/earth2me/essentials/signs/SignSell.java index 9df1ec874..2a5a8cfcc 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignSell.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignSell.java @@ -29,7 +29,7 @@ public class SignSell extends EssentialsSign charge.isAffordableFor(player); money.pay(player); charge.charge(player); - Trade.log("Sign", "Sell", "Interact", username, charge, username, money, ess); + Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index 544c3216e..6c0205d34 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -24,7 +24,7 @@ public class SignTrade extends EssentialsSign charge.isAffordableFor(player); sign.setLine(3, "ยง8" + username); charge.charge(player); - Trade.log("Sign", "Trade", "Create", username, charge, username, null, ess); + Trade.log("Sign", "Trade", "Create", username, charge, username, null, sign.getBlock().getLocation(), ess); return true; } @@ -36,7 +36,7 @@ public class SignTrade extends EssentialsSign final Trade stored = getTrade(sign, 1, true, true, ess); substractAmount(sign, 1, stored, ess); stored.pay(player); - Trade.log("Sign", "Trade", "OwnerInteract", username, null, username, stored, ess); + Trade.log("Sign", "Trade", "OwnerInteract", username, null, username, stored, sign.getBlock().getLocation(), ess); } else { @@ -47,7 +47,7 @@ public class SignTrade extends EssentialsSign trade.pay(player); addAmount(sign, 1, charge, ess); charge.charge(player); - Trade.log("Sign", "Trade", "Interact", sign.getLine(3), charge, username, trade, ess); + Trade.log("Sign", "Trade", "Interact", sign.getLine(3), charge, username, trade, sign.getBlock().getLocation(), ess); } sign.updateSign(); return true; @@ -63,7 +63,7 @@ public class SignTrade extends EssentialsSign final Trade stored2 = getTrade(sign, 2, true, false, ess); stored1.pay(player); stored2.pay(player); - Trade.log("Sign", "Trade", "Break", username, stored2, username, stored1, ess); + Trade.log("Sign", "Trade", "Break", username, stored2, username, stored1, sign.getBlock().getLocation(), ess); return true; } else |