From e82ee71bd93ee076485788a67ff9b9577ddc3cdf Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 28 Jan 2012 00:57:08 +0000 Subject: If bed home is set, give priority when spawning. --- .../essentials/spawn/EssentialsSpawnPlayerListener.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'EssentialsSpawn') 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) { -- cgit v1.2.3