Add missing safe log qualifications

This commit is contained in:
AlexTheCoder 2017-09-23 00:11:47 -04:00
parent 010b85d1c3
commit 128e16cbcd

View File

@ -71,6 +71,11 @@ public class SafeLog extends MiniPlugin
isSafeLog = true;
}
if (Managers.get(ClansFreezeManager.class).isPanicking(player))
{
isSafeLog = true;
}
if (Managers.get(RestartManager.class).isRestarting())
{
isSafeLog = true;
@ -81,14 +86,21 @@ public class SafeLog extends MiniPlugin
isSafeLog = true;
}
if (_clansManager.hasTimer(player))
{
isSafeLog = true;
}
if (_clansManager.getIncognitoManager().Get(player).Status)
{
isSafeLog = true;
}
if (!isSafeLog)
{
if (!_clansManager.getIncognitoManager().Get(player).Status)
{
NPCManager.getInstance().spawnLogoutNpc(player);
}
}
}
public void onPlayerJoin(final Player player)
{
@ -117,14 +129,11 @@ public class SafeLog extends MiniPlugin
stream.close();
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
{
public void run()
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), () ->
{
_clansManager.ClanTips.displayTip(TipType.NPC_RIPPARONI, player);
UtilPlayer.message(player, F.main("SafeLog", "You were killed by " + F.elem(killerName) + " when you logged out! This happened about " + F.time(UtilTime.MakeStr(System.currentTimeMillis() - time))) + " ago.");
UtilTextMiddle.display("Offline Death", "Log out in a safer place next time!", 15, 80, 40, player);
}
}, 15);
deathFile.delete();