Fix for sending messages to the wrong player.

This commit is contained in:
Acrobot 2013-03-03 17:26:10 +01:00
parent 7c9642e9ff
commit 07b15d7da3
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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;