From 07b15d7da3a404e4104e6642b75f0c1f009b61f6 Mon Sep 17 00:00:00 2001 From: Acrobot Date: Sun, 3 Mar 2013 17:26:10 +0100 Subject: [PATCH] Fix for sending messages to the wrong player. --- .../Listeners/PostTransaction/TransactionMessageSender.java | 4 +++- com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/com/Acrobot/ChestShop/Listeners/PostTransaction/TransactionMessageSender.java b/com/Acrobot/ChestShop/Listeners/PostTransaction/TransactionMessageSender.java index deb3dfe..6f57d3d 100644 --- a/com/Acrobot/ChestShop/Listeners/PostTransaction/TransactionMessageSender.java +++ b/com/Acrobot/ChestShop/Listeners/PostTransaction/TransactionMessageSender.java @@ -6,6 +6,7 @@ import com.Acrobot.ChestShop.Configuration.Messages; import com.Acrobot.ChestShop.Configuration.Properties; import com.Acrobot.ChestShop.Economy.Economy; import com.Acrobot.ChestShop.Events.TransactionEvent; +import com.Acrobot.ChestShop.Utils.uName; import com.google.common.base.Joiner; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -88,8 +89,9 @@ public class TransactionMessageSender implements Listener { private static void sendMessageToOwner(String message, TransactionEvent event) { String owner = event.getOwner().getName(); + owner = uName.getName(owner); - Player player = Bukkit.getPlayer(owner); + Player player = Bukkit.getPlayerExact(owner); if (player != null) { player.sendMessage(message); diff --git a/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java b/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java index 5698276..cd612d4 100644 --- a/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java +++ b/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java @@ -74,7 +74,7 @@ public class LightweightChestProtection implements Listener { } Block block = event.getBlock(); - Player player = Bukkit.getPlayer(event.getName()); + Player player = Bukkit.getPlayerExact(event.getName()); if (player == null || limitsModule.hasReachedLimit(player, block.getType())) { return;