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

Changed PermissibleBase to trait to remove boilerplate #2511

Closed
wants to merge 3 commits into from

Conversation

SOF3
Copy link
Member

@SOF3 SOF3 commented Nov 2, 2018

Introduction

Implementing Permissible is based on PermissibleBase, but redirecting the method calls produces a lot of boilerplate code. This PR converts PermissibleBase to an actual trait that implements the Permissible methods.

Changes

API changes

  • Added PermissibleTrait
  • Removed PermissibleBase

Behavioural changes

none

Backwards compatibility

Classes that extend/contain PermissibleBase have to switch to use PermissibleTrait;. Remember to call initPermissible() and clearPermissions().

Tests

Works when player join and quits with almost no plugins. Not everything has been carefully tested.

@SOF3 SOF3 added Category: API Related to the plugin API Category: Cosmetic Related to formatting or code style BC break Breaks API compatibility labels Nov 2, 2018
@SOF3 SOF3 self-assigned this Nov 2, 2018
@dktapps
Copy link
Member

dktapps commented Nov 3, 2018

It's been discussed to instead keep this as a subcomponent and remove the Permissible implementation from Player. This would solve the problem as well, along with others related to code complexity.

@dktapps dktapps added this to the 4.0 milestone Nov 3, 2018
@SOF3
Copy link
Member Author

SOF3 commented Nov 4, 2018

This change is better combined with the removal of other implementations from Player, hopefully including Vector3, Entity, etc.

@dktapps
Copy link
Member

dktapps commented Jul 3, 2019

3c677bd resolves the boilerplate issue, but it also creates conflicts with this pull. Since the majority of its purpose has been obsoleted, I'm closing this.

@dktapps dktapps closed this Jul 3, 2019
@dktapps dktapps added the Resolution: Obsolete Superseded by other changes label Jul 3, 2019
@dktapps dktapps deleted the permissiblebase-trait branch July 3, 2019 16:28
@dktapps dktapps added Type: Contribution and removed Category: Cosmetic Related to formatting or code style labels Nov 9, 2022
@dktapps dktapps added Type: Enhancement Contributes features or other improvements to PocketMine-MP and removed Type: Contribution labels Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Resolution: Obsolete Superseded by other changes Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants