mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-13 06:27:01 +00: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();
|
user.toggleVanished();
|
||||||
}
|
}
|
||||||
if (!user.isJailed())
|
user.setLogoutLocation();
|
||||||
{
|
|
||||||
user.setLastLocation();
|
|
||||||
}
|
|
||||||
if (user.isRecipeSee())
|
if (user.isRecipeSee())
|
||||||
{
|
{
|
||||||
user.getPlayer().getOpenInventory().getTopInventory().clear();
|
user.getPlayer().getOpenInventory().getTopInventory().clear();
|
||||||
|
|
|
@ -48,4 +48,6 @@ public interface IUser extends Player
|
||||||
boolean isAfk();
|
boolean isAfk();
|
||||||
|
|
||||||
void setAfk(final boolean set);
|
void setAfk(final boolean set);
|
||||||
|
|
||||||
|
void setLogoutLocation();
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,6 +254,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
setLastLocation(getLocation());
|
setLastLocation(getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLogoutLocation()
|
||||||
|
{
|
||||||
|
setLogoutLocation(getLocation());
|
||||||
|
}
|
||||||
|
|
||||||
public void requestTeleport(final User player, final boolean here)
|
public void requestTeleport(final User player, final boolean here)
|
||||||
{
|
{
|
||||||
teleportRequestTime = System.currentTimeMillis();
|
teleportRequestTime = System.currentTimeMillis();
|
||||||
|
|
|
@ -318,6 +318,17 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||||
config.setProperty("lastlocation", loc);
|
config.setProperty("lastlocation", loc);
|
||||||
config.save();
|
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 lastTeleportTimestamp;
|
||||||
|
|
||||||
private long _getLastTeleportTimestamp()
|
private long _getLastTeleportTimestamp()
|
||||||
|
|
Loading…
Reference in a new issue