McPlayHDnet / McPlayHD.net

0 stars 0 forks source link

Flying Bug (Allows you to fly without fly permissions) #156

Open flxrr opened 2 years ago

flxrr commented 2 years ago

https://user-images.githubusercontent.com/87279972/162634344-efeedc46-a69e-47a9-8142-9e864bac8e25.mp4

clip by Dazziling

McPlayHD commented 2 years ago

Could you maybe find out how exactly to reproduce this issue? Because it never happened to me during testing and also if I remember correctly, you can't even start a Jump'n'Run when you are flying.

obvTiger commented 2 years ago

I don't know the code of the double jump, but that happens also when you're in the cake rush queue and the server laggs really bad that also happens.

Lets say you coded the double jump with toggling flight on and off and pushing the player forwards somehow in the tick between that happens like in this example of code(not containing the pushing mechanic):

    player.setFlying(true);
    player.playSound(player.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 500.0f, 1.0f);
    player.setFlying(false);

that means when he falls down the event gets canceled on line 1 of my example, that's why you also hear no bat takeoff sound. fix: if the timer of the j&r is running, cancel any event that has to do with the double jump and display something in the hotbar mabe

McPlayHD commented 2 years ago

That's not how it works. I never set the player flying. I just allow flying but cancel the PlayerToggleFlightEvent every time it is called and set AllowFlight to false until the player touches the ground again. It could now be that depending on what client you use packets get discarded and the player then actually can fly even though the server thinks he doesn't... I really need a precise "how to reproduce" or I really can't fix this and have to assume it's a client error.