mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 00:58:50 +01:00
Fix respawn-at-anchor setting. (#5825)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
parent
57c9edcc0c
commit
c7cc1b4f93
@ -41,21 +41,23 @@ class EssentialsSpawnPlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_1_R01) && event.isAnchorSpawn() && ess.getSettings().isRespawnAtAnchor()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ess.getSettings().getRespawnAtHome()) {
|
if (ess.getSettings().getRespawnAtHome()) {
|
||||||
final Location home;
|
final Location home;
|
||||||
|
|
||||||
Location bed = null;
|
Location respawnLocation = null;
|
||||||
if (ess.getSettings().isRespawnAtBed()) {
|
if (ess.getSettings().isRespawnAtBed() &&
|
||||||
|
(!VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_1_R01) ||
|
||||||
|
(!event.isAnchorSpawn() || ess.getSettings().isRespawnAtAnchor()))) {
|
||||||
// cannot nuke this sync load due to the event being sync so it would hand either way
|
// cannot nuke this sync load due to the event being sync so it would hand either way
|
||||||
bed = user.getBase().getBedSpawnLocation();
|
if(VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_1_R01)) {
|
||||||
|
respawnLocation = user.getBase().getRespawnLocation();
|
||||||
|
} else { // For versions prior to 1.16.
|
||||||
|
respawnLocation = user.getBase().getBedSpawnLocation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bed != null) {
|
if (respawnLocation != null) {
|
||||||
home = bed;
|
home = respawnLocation;
|
||||||
} else {
|
} else {
|
||||||
home = user.getHome(user.getLocation());
|
home = user.getHome(user.getLocation());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user