mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-05 02:19:52 +01:00
[trunk] Fix bug on upgrade the home locations
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1301 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
224c18348a
commit
088508bd37
@ -193,7 +193,7 @@ public class EssentialsUpgrade
|
||||
{
|
||||
user.setMails(mails);
|
||||
}
|
||||
if (user.getHome() == null)
|
||||
if (!user.hasHome())
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> vals = (List<Object>)usersConfig.getProperty(username + ".home");
|
||||
|
@ -87,10 +87,21 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
}
|
||||
}
|
||||
|
||||
public Location getHome()
|
||||
public boolean hasHome()
|
||||
{
|
||||
if (config.hasProperty("home"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Location getHome()
|
||||
{
|
||||
if (!hasHome())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
World world = getLocation().getWorld();
|
||||
String worldHome = "home.worlds." + world.getName().toLowerCase();
|
||||
if (!config.hasProperty(worldHome))
|
||||
@ -101,8 +112,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
Location loc = config.getLocation(worldHome, getServer());
|
||||
return loc;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setHome(Location loc, boolean b)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user