Solved Flying glitch - unsure on how to fix.

Discussion in 'Spigot Plugin Development' started by TheMasteredPanda, May 22, 2016.

  1. 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?



    Panda :).
  2. 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):
    Instead of:

    Code (Text):
    On lines 109 and 118 ;).
    • Agree Agree x 1
  3. 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 :)
  4. Ahh cheers, found another bug as well but I know how to sort that out. Thank you very much <3.