If bed home is set, give priority when spawning.

This commit is contained in:
KHobbits 2012-01-28 00:57:08 +00:00
parent f7c6759433
commit d1d31e9769

View File

@ -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)
{