feat: chef commands moved to admin + PlaceholderAPI integration
Chef → admin: the chef role no longer grants any command privilege. All team-management subcommands now take <team> as an argument and are gated by their crcore.team.<action> permission only: - add <team> <player> - remove <team> <player> - transfer <team> <player> - visibility <team> <PUBLIC|PRIVATE> - setspawn <team> (still player-only — needs admin's location) The LEADER role is kept in the data model (Team / TeamMember) and remains usable by game plugins via the API, but does not unlock any default command. Future work can re-introduce chef-specific commands if needed. PlaceholderAPI: auto-detected at CRCore.enable(). If the PAPI plugin is present on the server, CRCorePlaceholderExpansion registers automatically; otherwise the lib runs without it (no NoClassDefFoundError thanks to the indirection through doRegisterPlaceholderHook). Placeholders exposed: - Team: %crcore_team%, %crcore_team_name/tag/color/color_chat/size/ visibility/leader_name/total_score%, %crcore_team_score_<name>% - Player: %crcore_player_score_<name>%, %crcore_player_score_total% Dependency: me.clip:placeholderapi:2.11.6, scope provided. New repo: https://repo.extendedclip.com/content/repositories/placeholderapi/. docs/features.md, decisions.md and the builtin-commands diagram updated to reflect the simpler admin/player two-tier model and the PAPI section. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
@startuml builtin-commands-diagram
|
||||
title CR-Core — Default /core team commands (admin / chef / joueur)
|
||||
title CR-Core — Default /core team commands (admin / joueur)
|
||||
|
||||
skinparam classAttributeIconSize 0
|
||||
hide empty members
|
||||
@@ -11,16 +11,13 @@ package "fr.luc.crcore.command" {
|
||||
|
||||
package "fr.luc.crcore.command.builtin" {
|
||||
|
||||
class CoreCommand {
|
||||
+ CoreCommand(teamSvc, playerSvc)
|
||||
}
|
||||
class CoreCommand
|
||||
CoreCommand --|> BaseCommand
|
||||
|
||||
package "fr.luc.crcore.command.builtin.team" {
|
||||
|
||||
class TeamGroupSubCommand {
|
||||
+ TeamGroupSubCommand(service)
|
||||
# registerDefaults(): void
|
||||
}
|
||||
TeamGroupSubCommand --|> SubCommand
|
||||
|
||||
@@ -28,7 +25,7 @@ package "fr.luc.crcore.command.builtin" {
|
||||
+ {static} teamByName(service): ArgumentType<Team>
|
||||
}
|
||||
|
||||
' === ADMIN commands (permission seule) ===
|
||||
' ─── ADMIN commands (permission seule, team par argument) ───
|
||||
package "admin" <<Rectangle>> {
|
||||
class TeamCreateSubCommand {
|
||||
perm: crcore.team.create
|
||||
@@ -46,32 +43,30 @@ package "fr.luc.crcore.command.builtin" {
|
||||
perm: crcore.team.score
|
||||
args: <team> <name> <add|set> <value>
|
||||
}
|
||||
}
|
||||
|
||||
' === CHEF commands (permission + check chef) ===
|
||||
package "chef" <<Rectangle>> {
|
||||
class TeamAddSubCommand {
|
||||
perm: crcore.team.add
|
||||
args: <player>
|
||||
args: <team> <player>
|
||||
}
|
||||
class TeamRemoveSubCommand {
|
||||
perm: crcore.team.remove
|
||||
args: <player>
|
||||
args: <team> <player>
|
||||
}
|
||||
class TeamTransferSubCommand {
|
||||
perm: crcore.team.transfer
|
||||
args: <player>
|
||||
args: <team> <player>
|
||||
}
|
||||
class TeamVisibilitySubCommand {
|
||||
perm: crcore.team.visibility
|
||||
args: <vis>
|
||||
args: <team> <vis>
|
||||
}
|
||||
class TeamSetSpawnSubCommand {
|
||||
perm: crcore.team.setspawn
|
||||
args: <team>
|
||||
playerOnly
|
||||
}
|
||||
}
|
||||
|
||||
' === PLAYER commands ===
|
||||
' ─── PLAYER commands ───
|
||||
package "player" <<Rectangle>> {
|
||||
class TeamJoinSubCommand {
|
||||
perm: crcore.team.join
|
||||
@@ -114,6 +109,11 @@ package "fr.luc.crcore.command.builtin" {
|
||||
}
|
||||
|
||||
note bottom of TeamGroupSubCommand
|
||||
Le rôle LEADER reste dans le modèle Team
|
||||
(utilisable par les game plugins via l'API)
|
||||
mais n'accorde aucun privilège de commande
|
||||
dans le set par défaut.
|
||||
|
||||
Override d'une feuille :
|
||||
core.getCoreCommand()
|
||||
.findSubCommand("team")
|
||||
|
||||
Reference in New Issue
Block a user