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

Gameplay permissions #5544

Draft
wants to merge 6 commits into
base: minor-next
Choose a base branch
from
Draft

Gameplay permissions #5544

wants to merge 6 commits into from

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Jan 30, 2023

Introduction

This PR implements #5512.

The motivation for this PR is described in #5512.

Relevant issues

Closes #5512

Changes

API changes

Behavioural changes

  • The following things are now controllable by permissions:
    • Chatting
    • Placing, breaking and interacting with blocks
    • Dropping, picking up, and activating items
    • Creating new items (e.g. from the creative inventory)
    • Attacking and interacting with entities
    • Flight
  • Game modes now apply abilities by setting a permission group to true on the player.
  • Various places that previously used game mode checks (e.g. dropping items, interacting with blocks, attacking entities) now check for permissions instead.
  • If a plugin uses Player->setAllowFlight(), it will now persist across game mode changes. This differs from the previous behaviour, where changing from creative to survival would make the player unable to fly.

Backwards compatibility

Behavioural change to setAllowFlight() described above may be unexpected to plugins.

Follow-up

Add further permissions for the following:

  • Opening containers

Tests

This has been tested in-game.

@dktapps dktapps added Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP Category: UI Related to the user interface (e.g. commands, terminal output) labels Jan 30, 2023
@dktapps dktapps added the Status: Blocked Depends on other changes which are yet to be completed label Nov 14, 2024
@dktapps
Copy link
Member Author

dktapps commented Nov 29, 2024

Blocking items:

  • New permissions need descriptions localizing
  • Behavioural BC break of setAllowFlight() - this can be addressed by removing the base permission during gamemode change - since we'll probably remove setAllowFlight() in major-next, this workaround is probably OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Category: UI Related to the user interface (e.g. commands, terminal output) Status: Blocked Depends on other changes which are yet to be completed Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant