mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-02 11:11:58 +01:00
Don't overwrite last location on logout
Logout position is saved as logoutlocation now in users yml
This commit is contained in:
parent
335d8b7f20
commit
5b975672e8
@ -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();
|
||||
|
@ -48,4 +48,6 @@ public interface IUser extends Player
|
||||
boolean isAfk();
|
||||
|
||||
void setAfk(final boolean set);
|
||||
|
||||
void setLogoutLocation();
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user