Skip to content

Feature: PlayerAbilities #422

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

Closed
Miro-Andrin opened this issue May 11, 2021 · 1 comment
Closed

Feature: PlayerAbilities #422

Miro-Andrin opened this issue May 11, 2021 · 1 comment

Comments

@Miro-Andrin
Copy link
Contributor

Feature Request

Handle PlayerAbilities request in feather/server/src/packet_handlers.rs

Description

wiki
The vanilla client sends this packet when the player starts/stops flying (like in creative mode).

Describe the solution you'd like

Add a component IsCreativeFlying on Player entities that track if a player is flying or not, and add a event CreativeFlyingChange. When this packet is recived we update the IsCreativeFlying component and issue the CreativeFlyingChange event.
Somewhere we also need to keep track if the player needs to be kicked if they are not in creative mode, but that could reasonably be handled elsewhere, or left out for plugins to handle.

1)

Create a IsCreativeFlying component in quill.

2)

Create a CreativeFlyingChange Event. This is almost the same steps as for 1), but you should look at quill/common/events

3)

Add a handle function in feather/server/src/packet_handlers.rs for handling the PlayerAbilities packet, that issues the event and updates the component. For an example on how to trigger the event go to feather/server/src/packet_handlers/interaction.rs, or go directly to the method.

4)

Create a is_creative_flying_check system in feather/server/src/systems that listens for the CreativeFlyingChange event and kicks players if they are not in creative mode (and they are turning flying on).

Note however that the main maintainer Caelum, is rewriting the ecs, so some methods might soon move to a different file, but the function will probably be the same.

@Miro-Andrin Miro-Andrin changed the title PlayerAbilities Feature: PlayerAbilities May 11, 2021
@Miro-Andrin
Copy link
Contributor Author

Everything except 4) is implemented, so i think we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant