Don't change player flySpeed on join/spec.

From a purist standpoint, the flySpeed tag should never be messed with
in MobArena, because simply turning off flight should be enough. It is
likely that the flySpeed tag was originally included to cull "cheaters"
who somehow managed to activate flight in the arena anyway, but this
isn't really MobArena's responsibility and can very probably be handled
by other means of cheat prevention in WorldGuard regions or the like.

By not touching the flySpeed tag, it makes it much easier for server
owners to recover from crashes where the leave steps aren't executed,
leaving players "locked in the air" when they try to fly.

Closes #509 since this "fix" was the reason that feature request was made.
This commit is contained in:
Andreas Troelsen 2019-02-03 14:08:13 +01:00
parent eb67ec77b9
commit 0e037b2f72
2 changed files with 1 additions and 4 deletions

View File

@ -11,6 +11,7 @@ These changes will (most likely) be included in the next version.
## [Unreleased]
- MobArena no longer touches the `flySpeed` player attribute when players join an arena. This should fix issues where a crash would result in players being "locked in the air" when trying to fly outside of the arena. It also introduces compatibility with plugins that use flight to augment player abilities.
## [0.103.1] - 2018-12-31
- Like the other user commands, the permission for `/ma ready` now defaults to true.

View File

@ -5,7 +5,6 @@ import org.bukkit.entity.Player;
class SetFlying extends PlayerStep {
private boolean allow;
private boolean flying;
private float speed;
private SetFlying(Player player) {
super(player);
@ -15,9 +14,7 @@ class SetFlying extends PlayerStep {
public void run() {
allow = player.getAllowFlight();
flying = player.isFlying();
speed = player.getFlySpeed();
player.setFlySpeed(0);
player.setFlying(false);
player.setAllowFlight(false);
}
@ -26,7 +23,6 @@ class SetFlying extends PlayerStep {
public void undo() {
player.setAllowFlight(allow);
player.setFlying(flying);
player.setFlySpeed(speed);
}
static StepFactory create() {