1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-08 15:46:54 +02:00

Don't return offline players with getPlayer()

This commit is contained in:
snowleo
2011-07-20 22:14:56 +02:00
parent e8ff59b9aa
commit fa2fa54fe2

View File

@@ -6,6 +6,7 @@ import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.OfflinePlayer;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -44,7 +45,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
User user = ess.getAllUsers().get(args[pos].toLowerCase());
if (user != null)
{
if(!getOffline && user.isHidden())
if(!getOffline && (user.getBase() instanceof OfflinePlayer || user.isHidden()))
{
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
}