Hello, alright so I made this Towny Fly plugin to allow members of towns to fly in their joined town. Thought I had it all working but I have identified a glitch that I thought I fixed? Somehow I am able to outside of the town, get my teleportation disabled and still able to fly outside of my joined town, THEN when I open up my inventory it turns my fly off? How is this problem happening? Video: Code: https://github.com/StuddedExpandable/TownyFly/blob/master/src/thevoxstudios/vtownyfly/TownyFly.java Cheers, Panda .
Whenever you execute the command, you are doing setAllowFlight(true), but whenever you leave the plot, it teleports you to the ground and does setFlying(false), you might not be flying, but you have access to fly. Whenever you toggle off flying via command, you did what I'm saying right now, so just repeat that whenever you leave a plot. So you should do: Code (Text): setFlying(false) setAllowFlight(false) Instead of: Code (Text): setFlying(false) On lines 109 and 118 .
In your code under the listener onPlotLeave, you are only disabling their flight and teleporting. You forgot to add p.setAllowFlight(false); =) Hope it solves it. EDIT: Didn't see first answer but its basically the same