[SPIGOT-6375] Provide static factory from PermissibleBase Created: 22/Feb/21  Updated: 22/Feb/21

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Matthew Sanders Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: Craftbukkit, bukkit, permissions
Environment:

Bukkit, specification.

CraftBukkit, refactor/implementation.


Version: 1.16.5-R0.1-SNAPSHOT
Guidelines Read: Yes

 Description   

At present, the prevailing solution to offer greatest programmability for permission logic involves runtime reflection on implementation player objects (specifically, CraftPlayer). I propose creating a static Function<ServerOperator, PermissibleBase> field in PermissibleBase with static setter and a corresponding static factory. A permission plugin may thus register the constructor of its custom subclass with no reflection required, allowing for cleaner override of CraftBukkit implementation.

I would like to discuss interest in this feature. It represents a small change in the API and a few changes to CraftBukkit classes which currently invoke new PermissibleBase(ServerOperator).


Generated at Sat Apr 05 09:53:21 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.