summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/IUser.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/UserData.java11
4 files changed, 20 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index c7b7b3201..a331b6378 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -138,10 +138,7 @@ public class EssentialsPlayerListener implements Listener
{
user.toggleVanished();
}
- if (!user.isJailed())
- {
- user.setLastLocation();
- }
+ user.setLogoutLocation();
if (user.isRecipeSee())
{
user.getPlayer().getOpenInventory().getTopInventory().clear();
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java
index 1b5f314be..5bc5f6373 100644
--- a/Essentials/src/com/earth2me/essentials/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/IUser.java
@@ -48,4 +48,6 @@ public interface IUser extends Player
boolean isAfk();
void setAfk(final boolean set);
+
+ void setLogoutLocation();
}
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 3a6b42781..5d5661646 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -253,6 +253,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
setLastLocation(getLocation());
}
+
+ @Override
+ public void setLogoutLocation()
+ {
+ setLogoutLocation(getLocation());
+ }
public void requestTeleport(final User player, final boolean here)
{
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java
index 930a9c913..6c963fb9b 100644
--- a/Essentials/src/com/earth2me/essentials/UserData.java
+++ b/Essentials/src/com/earth2me/essentials/UserData.java
@@ -318,6 +318,17 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("lastlocation", loc);
config.save();
}
+
+ public void setLogoutLocation(Location loc)
+ {
+ if (loc == null || loc.getWorld() == null)
+ {
+ return;
+ }
+ config.setProperty("logoutlocation", loc);
+ config.save();
+ }
+
private long lastTeleportTimestamp;
private long _getLastTeleportTimestamp()