diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index cba23d301..8f582769e 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -193,7 +193,7 @@ public class EssentialsUpgrade { user.setMails(mails); } - if (user.getHome() == null) + if (!user.hasHome()) { @SuppressWarnings("unchecked") List vals = (List)usersConfig.getProperty(username + ".home"); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 941950c4e..170394014 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -87,21 +87,30 @@ public abstract class UserData extends PlayerExtension implements IConf } } - public Location getHome() + public boolean hasHome() { if (config.hasProperty("home")) { - World world = getLocation().getWorld(); - String worldHome = "home.worlds." + world.getName().toLowerCase(); - if (!config.hasProperty(worldHome)) - { - String defaultWorld = config.getString("home.default"); - worldHome = "home.worlds." + defaultWorld; - } - Location loc = config.getLocation(worldHome, getServer()); - return loc; + return true; } - return null; + return false; + } + + public Location getHome() + { + if (!hasHome()) + { + return null; + } + World world = getLocation().getWorld(); + String worldHome = "home.worlds." + world.getName().toLowerCase(); + if (!config.hasProperty(worldHome)) + { + String defaultWorld = config.getString("home.default"); + worldHome = "home.worlds." + defaultWorld; + } + Location loc = config.getLocation(worldHome, getServer()); + return loc; } public void setHome(Location loc, boolean b)