diff options
4 files changed, 5 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 97b0ac30d..9b16dd6b9 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -241,7 +241,7 @@ public class Teleport implements Runnable public void home(User user, String chargeFor) throws Exception { - Location loc = user.getHome(); + Location loc = user.getHome(this.user.getLocation()); if (loc == null) { if (ess.getSettings().spawnIfNoHome()) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 319509abc..782995159 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -95,13 +95,13 @@ public abstract class UserData extends PlayerExtension implements IConf return false; } - public Location getHome() + public Location getHome(Location location) { if (!hasHome()) { return null; } - World world = getLocation().getWorld(); + World world = location.getWorld(); String worldHome = "home.worlds." + world.getName().toLowerCase(); if (!config.hasProperty(worldHome)) { diff --git a/Essentials/test/com/earth2me/essentials/UserTest.java b/Essentials/test/com/earth2me/essentials/UserTest.java index 1acaeb55a..d6e04cc17 100644 --- a/Essentials/test/com/earth2me/essentials/UserTest.java +++ b/Essentials/test/com/earth2me/essentials/UserTest.java @@ -54,7 +54,7 @@ public class UserTest extends TestCase user.setHome(); OfflinePlayer base2 = server.createPlayer(base1.getName()); User user2 = ess.getUser(base2); - Location home = user2.getHome(); + Location home = user2.getHome(loc); assertEquals(loc.getWorld().getName(), home.getWorld().getName()); assertEquals(loc.getX(), home.getX()); assertEquals(loc.getY(), home.getY()); diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index ea60a490f..ace8cd50b 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -22,7 +22,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { if (Essentials.getStatic().getSettings().getRespawnAtHome()) { - Location home = user.getHome(); + Location home = user.getHome(user.getLocation()); if (home == null) { throw new Exception(); } |