• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

Denied Fly Glitch Possible Solution

Status
Not open for further replies.

Simplicitee

Staff member
Plugin Developer
Verified Member
This would provide a fix to the all dreaded Fly Glitch

What this needs:
-A Pk flying perm [bending.fly possibly]
-A few coding things

First off this would add an ArrayList as such [ArrayList<Player> flying]
This would store the players that are using a flying ability. Whenever they use an ability that enables their fly mode, they will be added to the ArrayList, and whenever they stopped using the ability, they would be removed. This also needs a new method in GeneralMethods:
Code:
public static boolean isUsingFlyingAbility(Player player) {
    if (flying.contains(player)) {
       return true;
    }
    return false;
}
Now this needs one last thing somewhere in the Runnable class method run():
Code:
public static void run() {
    for (Player player : Bukkit.getOnlinePlayers()) {
        if (!GeneralMethods.isUsingFlyingAbility(player) && !player.hasPermission("bending.fly")) {
           player.setFlying(false);
           player.setAllowFlight(false);
        }
    }
}
I know it's not the greatest, but it's a fix.
I'm sure the devs could perfect this and make it work beautifully
 

OmniCypher

Staff member
Lead Developer
Administrator
Plugin Developer
No, sadly this approach wouldn't work due to all the almost infinite number of plugins which allow a player to use fly mode. Its possible to account for well used things like Essentials but there is no possible way we could ever account for every plugin which uses fly mode to a point where it wouldn't get a little messed up when using bending. I have been thinking of ways we could bypass this and attempt to "hardcode" various moves of PK to cancel fly mode when hit. I've been squashing A LOT of bugs lately and this is one on my list.
 

Simplicitee

Staff member
Plugin Developer
Verified Member
No, sadly this approach wouldn't work due to all the almost infinite number of plugins which allow a player to use fly mode. Its possible to account for well used things like Essentials but there is no possible way we could ever account for every plugin which uses fly mode to a point where it wouldn't get a little messed up when using bending. I have been thinking of ways we could bypass this and attempt to "hardcode" various moves of PK to cancel fly mode when hit. I've been squashing A LOT of bugs lately and this is one on my list.
Darn
 

AlexTheCoder

Staff member
Plugin Developer
Verified Member
No, sadly this approach wouldn't work due to all the almost infinite number of plugins which allow a player to use fly mode. Its possible to account for well used things like Essentials but there is no possible way we could ever account for every plugin which uses fly mode to a point where it wouldn't get a little messed up when using bending.
Yeah, thats what I was trying to say lol
 

Joeri

Verified Member
Then make it so it works with essentials and tell people to get that instead of any other shitty fly plugin lol, most servers use essentials anyway. You don't have to code it so it works with all, just say that it's only compatible with essentials.

Same happend with worldguard, i don't see a reason why we couldn't do the same for this
 

AlexTheCoder

Staff member
Plugin Developer
Verified Member
Then make it so it works with essentials and tell people to get that instead of any other shitty fly plugin lol, most servers use essentials anyway. You don't have to code it so it works with all, just say that it's only compatible with essentials.

Same happend with worldguard, i don't see a reason why we couldn't do the same for this
However, if someone requests support for a world-protection plugin/feature in an already supported plugin and it seems valid, most likely we will add that support
 
Status
Not open for further replies.
Top