Anti World Fly

Anti World Fly

72.4k Downloads

[Suggestion] Restore Flight Status on World Change

BlackBeltPanda opened this issue ยท 9 comments

commented

A suggestion from my players is to restore the flight status when changing to a world that allows flight.
On my Skyblock server, this would be especially handy as often my players forget to re-enable flight and jump off their island expecting to be able to fly only to fall into the void. XD

commented

Hello BlackBeltPanda,

Will look into that for the next update. ;-)

Cheers,

Pyves

commented

Awesome! Will probably issue an official release around next Thursday. ;-)

commented

Here's a test version. Could you please try it out? If you set the new toggleFlyingInNonBlockedWorlds configuration option to true, players will automatically start flying when joining a world in which flying is not blocked by the plugin.

AntiWorldFly-2.2.6.zip

The version is still labelled 2.2.6, but will change to 2.3 once the official update is released!

commented

Looking at the commits, it seems the new option allows any player to fly?
I have groups of players that are allowed to fly while regular players aren't allowed to.

commented

Is it okay if I add a permission associated with that configuration option?

commented

Alternatively, you could store players' flight status in a HashMap, though it won't survive plugin reloads or server restarts without storing it to a file on plugin disable.

commented

A good way to do it might be to check for two permissions. You could have one for AntiWorldFly and also a compatibility permission for Essentials' "essentials.fly" permission, as that's probably what most people use for flight. So just a simple
if (player.hasPermission("antiworldfly.fly") || player.hasPermission("essentials.fly"))
That way server owners who don't use Essentials can still specify a permission for flight and those who do use Essentials don't have to change their existing permissions setup.

commented

Permissions seem like the most sensible option. Have just done an additional commit!

commented

Awesome, looks great. =)