summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 4987f6ab1..b68b4e350 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -34,15 +34,15 @@ public class EssentialsSpawnPlayerListener implements Listener
if (ess.getSettings().getRespawnAtHome())
{
- Location home = user.getHome(user.getLocation());
- if (home == null)
+ Location home;
+ final Location bed = user.getBedSpawnLocation();
+ if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
{
- final Location bed = user.getBedSpawnLocation();
- if (bed.getBlock().getType() == Material.BED_BLOCK)
- {
- home = bed;
- }
-
+ home = bed;
+ }
+ else
+ {
+ home = user.getHome(user.getLocation());
}
if (home != null)
{