Initiate player leave when spectate-on-death: false.
Errata to commit 84a7a2ed8a.
The protocol after the join/leave process rework was:
- `spectate-on-death: true`: leave, then spec
- `spectate-on-death: false`: leave
The protocol now is:
- `spectate-on-death: true`: spec
- `spectate-on-death: false`: spec, then "leave"
I put "leave" in quotes, because _discarding_ the player here does not
invoke the part of the leave protocol that tries to ensure teleports go
through according to plan. By capitalizing on the "leave" part, making
it explicit that that's what we're doing in the next tick after warping
the player to the spectator area, we return to the form of the original
rework where we use coarser-grained state control to make things easier
to reason about.
A side-effect of this change is that if players somehow manage to kill
themselves in the lobby, they will be refunded the entry fee.
This commit is contained in:
@@ -881,7 +881,7 @@ public class ArenaImpl implements Arena
|
||||
messenger.tell(p, Msg.SPEC_PLAYER_SPECTATE);
|
||||
} else {
|
||||
plugin.getServer().getScheduler()
|
||||
.scheduleSyncDelayedTask(plugin, () -> discardPlayer(p));
|
||||
.scheduleSyncDelayedTask(plugin, () -> playerLeave(p));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user