summaryrefslogtreecommitdiffstats
path: root/EssentialsSpawn
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-01-28 00:57:08 +0000
committerKHobbits <rob@khobbits.co.uk>2012-01-28 00:57:08 +0000
commitd1d31e9769291e7c5e6ff93c55e588b88d5eb489 (patch)
tree127d032b13a042c77212a51f0749848625026150 /EssentialsSpawn
parentf7c6759433b814d317ffe79d0276d76e0a94a3d8 (diff)
downloadEssentials-d1d31e9769291e7c5e6ff93c55e588b88d5eb489.tar
Essentials-d1d31e9769291e7c5e6ff93c55e588b88d5eb489.tar.gz
Essentials-d1d31e9769291e7c5e6ff93c55e588b88d5eb489.tar.lz
Essentials-d1d31e9769291e7c5e6ff93c55e588b88d5eb489.tar.xz
Essentials-d1d31e9769291e7c5e6ff93c55e588b88d5eb489.zip
If bed home is set, give priority when spawning.
Diffstat (limited to 'EssentialsSpawn')
-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)
{