From c95f4e1c6c01582acc47a1357f547b623b917a54 Mon Sep 17 00:00:00 2001 From: Thijs Wiefferink Date: Sat, 13 Jun 2015 22:06:34 +0200 Subject: [PATCH] Fix problem with '/as addfriend' denying first-joined players Before it checked if the player had played before on the server in order to check if the friend will get accepted, but this fails when the player is playing for the first time. This has been repaired. --- .../nl/evolutioncoding/areashop/commands/AddfriendCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/AddfriendCommand.java b/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/AddfriendCommand.java index 3f47d4c..67fbcc6 100644 --- a/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/AddfriendCommand.java +++ b/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/AddfriendCommand.java @@ -101,7 +101,7 @@ public class AddfriendCommand extends CommandAreaShop { if(sender.hasPermission("areashop.addfriend") && sender instanceof Player) { if(region.isOwner((Player)sender)) { OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]); - if(!friend.hasPlayedBefore()) { + if(friend.getLastPlayed() == 0) { plugin.message(sender, "addfriend-notVisited", args[1]); return; }