mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-26 20:45:17 +01:00
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:
parent
eb67ec77b9
commit
0e037b2f72
@ -11,6 +11,7 @@ These changes will (most likely) be included in the next version.
|
|||||||
|
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [0.103.1] - 2018-12-31
|
||||||
- Like the other user commands, the permission for `/ma ready` now defaults to true.
|
- Like the other user commands, the permission for `/ma ready` now defaults to true.
|
||||||
|
@ -5,7 +5,6 @@ import org.bukkit.entity.Player;
|
|||||||
class SetFlying extends PlayerStep {
|
class SetFlying extends PlayerStep {
|
||||||
private boolean allow;
|
private boolean allow;
|
||||||
private boolean flying;
|
private boolean flying;
|
||||||
private float speed;
|
|
||||||
|
|
||||||
private SetFlying(Player player) {
|
private SetFlying(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
@ -15,9 +14,7 @@ class SetFlying extends PlayerStep {
|
|||||||
public void run() {
|
public void run() {
|
||||||
allow = player.getAllowFlight();
|
allow = player.getAllowFlight();
|
||||||
flying = player.isFlying();
|
flying = player.isFlying();
|
||||||
speed = player.getFlySpeed();
|
|
||||||
|
|
||||||
player.setFlySpeed(0);
|
|
||||||
player.setFlying(false);
|
player.setFlying(false);
|
||||||
player.setAllowFlight(false);
|
player.setAllowFlight(false);
|
||||||
}
|
}
|
||||||
@ -26,7 +23,6 @@ class SetFlying extends PlayerStep {
|
|||||||
public void undo() {
|
public void undo() {
|
||||||
player.setAllowFlight(allow);
|
player.setAllowFlight(allow);
|
||||||
player.setFlying(flying);
|
player.setFlying(flying);
|
||||||
player.setFlySpeed(speed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static StepFactory create() {
|
static StepFactory create() {
|
||||||
|
Loading…
Reference in New Issue
Block a user