diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-01-28 00:49:22 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-01-28 00:49:22 +0000 |
commit | 72885e1d6c04b4cfc09e5e7123ca11fd3c22c481 (patch) | |
tree | 5d3a555bf3c32a61321b9d370dce3401c9eaa92c /EssentialsSpawn | |
parent | 085250c72fb03477d40ca0a4daa8294930f91922 (diff) | |
download | Essentials-72885e1d6c04b4cfc09e5e7123ca11fd3c22c481.tar Essentials-72885e1d6c04b4cfc09e5e7123ca11fd3c22c481.tar.gz Essentials-72885e1d6c04b4cfc09e5e7123ca11fd3c22c481.tar.lz Essentials-72885e1d6c04b4cfc09e5e7123ca11fd3c22c481.tar.xz Essentials-72885e1d6c04b4cfc09e5e7123ca11fd3c22c481.zip |
Check bed still exist, for bed homes.
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 7ec9ee043..4987f6ab1 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -8,6 +8,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerRespawnEvent; @@ -36,7 +37,12 @@ public class EssentialsSpawnPlayerListener implements Listener Location home = user.getHome(user.getLocation()); if (home == null) { - home = user.getBedSpawnLocation(); + final Location bed = user.getBedSpawnLocation(); + if (bed.getBlock().getType() == Material.BED_BLOCK) + { + home = bed; + } + } if (home != null) { @@ -90,7 +96,7 @@ public class EssentialsSpawnPlayerListener implements Listener { return; } - + try { Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); |