Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flight Attribute doesn't properly sync to client flying #1454

Open
Soaryn opened this issue Aug 14, 2024 · 1 comment
Open

Flight Attribute doesn't properly sync to client flying #1454

Soaryn opened this issue Aug 14, 2024 · 1 comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 bug A bug or error triage Needs triaging and confirmation

Comments

@Soaryn
Copy link
Contributor

Soaryn commented Aug 14, 2024

Minecraft Version: 1.21.x

NeoForge Version: 21.1.6

Steps to Reproduce:

  1. Have some form of flight being provided via the attribute that is toggleable.
  2. Upon starting to fly, toggle the attribute off.
  3. This should result in the attribute turning off, on the server and flying and mayFly; however, because the client seems to get mayFly correctly turned off, flying is still followed through to be true. This causes the player to have flight, but also not be able to disengage said flight until they land potentially killing their character.

An example mod (if needed) to use is Mekanism with the gravity module in the chest piece. Spam space and the flight toggle (which is typically G I believe). You should wind up in a state where flying is true and mayFly is false on the server

Description of issue:
This might be a timing issue, but the client is setting the flying to true, AFTER the server has turned everything off.

@Soaryn Soaryn added the triage Needs triaging and confirmation label Aug 14, 2024
@Soaryn
Copy link
Contributor Author

Soaryn commented Aug 15, 2024

Seemingly, adding the following after the existing code in ServerGamePacketListenerImpl in handlePlayerAbilities might be enough, at least from testing I've done.

   if (packet.isFlying() != this.player.getAbilities().flying)
            player.onUpdateAbilities();

@sciwhiz12 sciwhiz12 added bug A bug or error 1.21.1 Targeted at Minecraft 1.21.1 labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 bug A bug or error triage Needs triaging and confirmation
Projects
None yet
Development

No branches or pull requests

2 participants