mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-10 10:28:22 +01:00
If bed home is set, give priority when spawning.
This commit is contained in:
parent
f7c6759433
commit
d1d31e9769
@ -34,15 +34,15 @@ public class EssentialsSpawnPlayerListener implements Listener
|
|||||||
|
|
||||||
if (ess.getSettings().getRespawnAtHome())
|
if (ess.getSettings().getRespawnAtHome())
|
||||||
{
|
{
|
||||||
Location home = user.getHome(user.getLocation());
|
Location home;
|
||||||
if (home == null)
|
|
||||||
{
|
|
||||||
final Location bed = user.getBedSpawnLocation();
|
final Location bed = user.getBedSpawnLocation();
|
||||||
if (bed.getBlock().getType() == Material.BED_BLOCK)
|
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
|
||||||
{
|
{
|
||||||
home = bed;
|
home = bed;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
home = user.getHome(user.getLocation());
|
||||||
}
|
}
|
||||||
if (home != null)
|
if (home != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user