mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 08:56:29 +00:00
Make lockup scheduler stop when someone logs off.
This commit is contained in:
parent
f2f59d2a0d
commit
8076ee822e
2 changed files with 24 additions and 6 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue