Make lockup scheduler stop when someone logs off.

This commit is contained in:
Steven Lawson 2012-11-20 20:09:24 -05:00
parent f2f59d2a0d
commit 8076ee822e
2 changed files with 24 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import java.util.Random;
import me.StevenLawson.TotalFreedomMod.TFM_Log;
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
@ -115,7 +116,7 @@ public class Command_lockup extends TFM_Command
private void startLockup(final Player p)
{
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
final TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
cancelLockup(playerdata);
@ -125,6 +126,8 @@ public class Command_lockup extends TFM_Command
@Override
public void run()
{
if (p.isOnline())
{
p.openWorkbench(null, true);
@ -133,6 +136,11 @@ public class Command_lockup extends TFM_Command
l.setYaw(random.nextFloat() * 360.0f);
p.teleport(l);
}
else
{
cancelLockup(playerdata);
}
}
}, 0L, 5L));
}
}

View file

@ -93,6 +93,16 @@ public class TFM_UserInfo
return playerdata;
}
public String getIpAddress()
{
return ip_address;
}
public String getPlayerName()
{
return player_name;
}
public boolean isOrbiting()
{
return this.is_orbiting;