diff options
author | snowleo <schneeleo@gmail.com> | 2013-02-08 22:26:21 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2013-02-08 22:26:21 +0100 |
commit | 3f31dc179b6817d83e6429d0656b119d98a1f422 (patch) | |
tree | 96c244216b6f9acf246cf4e5bc5dcc3462fc1ae2 | |
parent | 5b975672e823e51f95efa2d847064a21ef1e0a29 (diff) | |
download | Essentials-3f31dc179b6817d83e6429d0656b119d98a1f422.tar Essentials-3f31dc179b6817d83e6429d0656b119d98a1f422.tar.gz Essentials-3f31dc179b6817d83e6429d0656b119d98a1f422.tar.lz Essentials-3f31dc179b6817d83e6429d0656b119d98a1f422.tar.xz Essentials-3f31dc179b6817d83e6429d0656b119d98a1f422.zip |
Fix /seen command
3 files changed, 24 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java index 5bc5f6373..972165a39 100644 --- a/Essentials/src/com/earth2me/essentials/IUser.java +++ b/Essentials/src/com/earth2me/essentials/IUser.java @@ -50,4 +50,6 @@ public interface IUser extends Player void setAfk(final boolean set); void setLogoutLocation(); + + Location getLogoutLocation(); } diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 6c963fb9b..023214a13 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -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(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index b415108e2..7a94013e9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -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())); |