mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-10 16:48:05 +02:00
Don't set last location if it's invalid
This commit is contained in:
@@ -249,7 +249,8 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
}
|
||||
|
||||
public void clearAllPowertools() {
|
||||
public void clearAllPowertools()
|
||||
{
|
||||
powertools.clear();
|
||||
config.setProperty("powertools", powertools);
|
||||
config.save();
|
||||
@@ -278,7 +279,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
{
|
||||
return powertools.size() > 0;
|
||||
}
|
||||
|
||||
private Location lastLocation;
|
||||
|
||||
private Location _getLastLocation()
|
||||
@@ -300,6 +300,10 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
public void setLastLocation(Location loc)
|
||||
{
|
||||
if (loc == null || loc.getWorld() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastLocation = loc;
|
||||
config.setProperty("lastlocation", loc);
|
||||
config.save();
|
||||
@@ -787,7 +791,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("npc", set);
|
||||
config.save();
|
||||
}
|
||||
|
||||
private boolean arePowerToolsEnabled;
|
||||
|
||||
public boolean arePowerToolsEnabled()
|
||||
@@ -813,7 +816,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
{
|
||||
return config.getBoolean("powertoolsenabled", true);
|
||||
}
|
||||
|
||||
private Map<String, Object> kitTimestamps;
|
||||
|
||||
private Map<String, Object> _getKitTimestamps()
|
||||
@@ -842,5 +844,4 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("timestamps.kits", kitTimestamps);
|
||||
config.save();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user