mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Make lockup scheduler stop when someone logs off.
This commit is contained in:
parent
f2f59d2a0d
commit
8076ee822e
@ -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);
|
||||
|
||||
@ -126,12 +127,19 @@ public class Command_lockup extends TFM_Command
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
p.openWorkbench(null, true);
|
||||
if (p.isOnline())
|
||||
{
|
||||
p.openWorkbench(null, true);
|
||||
|
||||
Location l = p.getLocation().clone();
|
||||
l.setPitch(random.nextFloat() * 360.0f);
|
||||
l.setYaw(random.nextFloat() * 360.0f);
|
||||
p.teleport(l);
|
||||
Location l = p.getLocation().clone();
|
||||
l.setPitch(random.nextFloat() * 360.0f);
|
||||
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 New Issue
Block a user