1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-22 22:34:43 +02:00

Fix /seen command

This commit is contained in:
snowleo
2013-02-08 22:26:21 +01:00
parent fb4e1eefbe
commit 627f48f29c
3 changed files with 24 additions and 1 deletions

View File

@@ -50,4 +50,6 @@ public interface IUser extends Player
void setAfk(final boolean set);
void setLogoutLocation();
Location getLogoutLocation();
}

View File

@@ -65,6 +65,7 @@ public abstract class UserData extends PlayerExtension implements IConf
kitTimestamps = _getKitTimestamps();
nickname = _getNickname();
setIgnoredPlayers(_getIgnoredPlayers());
logoutLocation = _getLogoutLocation();
}
private double money;
@@ -319,12 +320,32 @@ public abstract class UserData extends PlayerExtension implements IConf
config.save();
}
private Location logoutLocation;
private Location _getLogoutLocation()
{
try
{
return config.getLocation("logoutlocation", getServer());
}
catch (Exception e)
{
return null;
}
}
public Location getLogoutLocation()
{
return logoutLocation;
}
public void setLogoutLocation(Location loc)
{
if (loc == null || loc.getWorld() == null)
{
return;
}
logoutLocation = loc;
config.setProperty("logoutlocation", loc);
config.save();
}

View File

@@ -75,7 +75,7 @@ public class Commandseen extends EssentialsCommand
if (extra)
{
sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress()));
final Location loc = player.getLastLocation();
final Location loc = player.getLogoutLocation();
if (loc != null)
{
sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));