only check hidden if !offline, compare user with offlineplayer class

This commit is contained in:
ementalo 2011-07-18 22:49:27 +01:00
parent 81cc5b1f28
commit 15687c20d0
3 changed files with 4 additions and 3 deletions

View file

@ -42,7 +42,7 @@ public class Jail extends BlockListener implements IConf
public void sendToJail(User user, String jail) throws Exception public void sendToJail(User user, String jail) throws Exception
{ {
if (user.getLastActivity() > 0) if (!(user.getBase() instanceof OfflinePlayer))
{ {
user.getTeleport().now(getJail(jail)); user.getTeleport().now(getJail(jail));
} }

View file

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
@ -74,7 +75,7 @@ public class Commandtogglejail extends EssentialsCommand
p.setJailTimeout(0); p.setJailTimeout(0);
p.sendMessage("§7You have been released"); p.sendMessage("§7You have been released");
p.setJail(null); p.setJail(null);
if (p.getLastActivity() > 0) if (!(p.getBase() instanceof OfflinePlayer))
{ {
p.getTeleport().back(); p.getTeleport().back();
} }

View file

@ -44,7 +44,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
User user = ess.getAllUsers().get(args[pos]); User user = ess.getAllUsers().get(args[pos]);
if (user != null) if (user != null)
{ {
if(user.isHidden()) if(!getOffline && user.isHidden())
{ {
throw new NoSuchFieldException(Util.i18n("playerNotFound")); throw new NoSuchFieldException(Util.i18n("playerNotFound"));
} }