Skip to content

Feature: PlayerAbilities #422

Description

@Miro-Andrin

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions