mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-28 01:57:33 +00:00
only check hidden if !offline, compare user with offlineplayer class
This commit is contained in:
parent
81cc5b1f28
commit
15687c20d0
3 changed files with 4 additions and 3 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue