diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-01-28 00:57:08 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-01-28 00:57:08 +0000 |
commit | e82ee71bd93ee076485788a67ff9b9577ddc3cdf (patch) | |
tree | 4ee0468b3b4b8a86fab1fcbd1d7712a1c3b53e43 | |
parent | 72885e1d6c04b4cfc09e5e7123ca11fd3c22c481 (diff) | |
download | Essentials-e82ee71bd93ee076485788a67ff9b9577ddc3cdf.tar Essentials-e82ee71bd93ee076485788a67ff9b9577ddc3cdf.tar.gz Essentials-e82ee71bd93ee076485788a67ff9b9577ddc3cdf.tar.lz Essentials-e82ee71bd93ee076485788a67ff9b9577ddc3cdf.tar.xz Essentials-e82ee71bd93ee076485788a67ff9b9577ddc3cdf.zip |
If bed home is set, give priority when spawning.
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 16 |
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) { |