File tree 1 file changed +11
-9
lines changed
EssentialsSpawn/src/main/java/com/earth2me/essentials/spawn
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -41,21 +41,23 @@ void onPlayerRespawn(final PlayerRespawnEvent event) {
41
41
return ;
42
42
}
43
43
44
- if (VersionUtil .getServerBukkitVersion ().isHigherThanOrEqualTo (VersionUtil .v1_16_1_R01 ) && event .isAnchorSpawn () && ess .getSettings ().isRespawnAtAnchor ()) {
45
- return ;
46
- }
47
-
48
44
if (ess .getSettings ().getRespawnAtHome ()) {
49
45
final Location home ;
50
46
51
- Location bed = null ;
52
- if (ess .getSettings ().isRespawnAtBed ()) {
47
+ Location respawnLocation = null ;
48
+ if (ess .getSettings ().isRespawnAtBed () &&
49
+ (!VersionUtil .getServerBukkitVersion ().isHigherThanOrEqualTo (VersionUtil .v1_16_1_R01 ) ||
50
+ (!event .isAnchorSpawn () || ess .getSettings ().isRespawnAtAnchor ()))) {
53
51
// cannot nuke this sync load due to the event being sync so it would hand either way
54
- bed = user .getBase ().getBedSpawnLocation ();
52
+ if (VersionUtil .getServerBukkitVersion ().isHigherThanOrEqualTo (VersionUtil .v1_16_1_R01 )) {
53
+ respawnLocation = user .getBase ().getRespawnLocation ();
54
+ } else { // For versions prior to 1.16.
55
+ respawnLocation = user .getBase ().getBedSpawnLocation ();
56
+ }
55
57
}
56
58
57
- if (bed != null ) {
58
- home = bed ;
59
+ if (respawnLocation != null ) {
60
+ home = respawnLocation ;
59
61
} else {
60
62
home = user .getHome (user .getLocation ());
61
63
}
You can’t perform that action at this time.
0 commit comments