mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-23 23:03:05 +02:00
Don't overwrite last location on logout
Logout position is saved as logoutlocation now in users yml
This commit is contained in:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user