From 15687c20d0ef0421b976f08453ccf8f4b01da0b4 Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 18 Jul 2011 22:49:27 +0100 Subject: [PATCH] only check hidden if !offline, compare user with offlineplayer class --- Essentials/src/com/earth2me/essentials/Jail.java | 2 +- .../com/earth2me/essentials/commands/Commandtogglejail.java | 3 ++- .../com/earth2me/essentials/commands/EssentialsCommand.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jail.java b/Essentials/src/com/earth2me/essentials/Jail.java index f867a68fd..fdc184055 100644 --- a/Essentials/src/com/earth2me/essentials/Jail.java +++ b/Essentials/src/com/earth2me/essentials/Jail.java @@ -42,7 +42,7 @@ public class Jail extends BlockListener implements IConf public void sendToJail(User user, String jail) throws Exception { - if (user.getLastActivity() > 0) + if (!(user.getBase() instanceof OfflinePlayer)) { user.getTeleport().now(getJail(jail)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java index c994cabaa..4f199e472 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.OfflinePlayer; import org.bukkit.Server; import org.bukkit.command.CommandSender; import com.earth2me.essentials.User; @@ -74,7 +75,7 @@ public class Commandtogglejail extends EssentialsCommand p.setJailTimeout(0); p.sendMessage("ยง7You have been released"); p.setJail(null); - if (p.getLastActivity() > 0) + if (!(p.getBase() instanceof OfflinePlayer)) { p.getTeleport().back(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java index 23f0b5014..663895ff7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java @@ -44,7 +44,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand User user = ess.getAllUsers().get(args[pos]); if (user != null) { - if(user.isHidden()) + if(!getOffline && user.isHidden()) { throw new NoSuchFieldException(Util.i18n("playerNotFound")); }