8b7cad3fce
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>
125 lines
3.2 KiB
Plaintext
125 lines
3.2 KiB
Plaintext
@startuml builtin-commands-diagram
|
|
title CR-Core — Default /core team commands (admin / joueur)
|
|
|
|
skinparam classAttributeIconSize 0
|
|
hide empty members
|
|
|
|
package "fr.luc.crcore.command" {
|
|
abstract class BaseCommand
|
|
abstract class SubCommand
|
|
}
|
|
|
|
package "fr.luc.crcore.command.builtin" {
|
|
|
|
class CoreCommand
|
|
CoreCommand --|> BaseCommand
|
|
|
|
package "fr.luc.crcore.command.builtin.team" {
|
|
|
|
class TeamGroupSubCommand {
|
|
+ TeamGroupSubCommand(service)
|
|
}
|
|
TeamGroupSubCommand --|> SubCommand
|
|
|
|
class TeamArgumentTypes <<utility>> {
|
|
+ {static} teamByName(service): ArgumentType<Team>
|
|
}
|
|
|
|
' ─── ADMIN commands (permission seule, team par argument) ───
|
|
package "admin" <<Rectangle>> {
|
|
class TeamCreateSubCommand {
|
|
perm: crcore.team.create
|
|
args: name, tag, color, [leader]
|
|
}
|
|
class TeamDeleteSubCommand {
|
|
perm: crcore.team.delete
|
|
args: <team>
|
|
}
|
|
class TeamSetLeaderSubCommand {
|
|
perm: crcore.team.setleader
|
|
args: <team> <player>
|
|
}
|
|
class TeamScoreSubCommand {
|
|
perm: crcore.team.score
|
|
args: <team> <name> <add|set> <value>
|
|
}
|
|
class TeamAddSubCommand {
|
|
perm: crcore.team.add
|
|
args: <team> <player>
|
|
}
|
|
class TeamRemoveSubCommand {
|
|
perm: crcore.team.remove
|
|
args: <team> <player>
|
|
}
|
|
class TeamTransferSubCommand {
|
|
perm: crcore.team.transfer
|
|
args: <team> <player>
|
|
}
|
|
class TeamVisibilitySubCommand {
|
|
perm: crcore.team.visibility
|
|
args: <team> <vis>
|
|
}
|
|
class TeamSetSpawnSubCommand {
|
|
perm: crcore.team.setspawn
|
|
args: <team>
|
|
playerOnly
|
|
}
|
|
}
|
|
|
|
' ─── PLAYER commands ───
|
|
package "player" <<Rectangle>> {
|
|
class TeamJoinSubCommand {
|
|
perm: crcore.team.join
|
|
args: <team>
|
|
}
|
|
class TeamLeaveSubCommand {
|
|
perm: crcore.team.leave
|
|
}
|
|
class TeamInfoSubCommand {
|
|
perm: crcore.team.info
|
|
args: [team]
|
|
}
|
|
class TeamListSubCommand {
|
|
perm: crcore.team.list
|
|
}
|
|
class TeamTopSubCommand {
|
|
perm: crcore.team.top
|
|
args: [score]
|
|
}
|
|
}
|
|
|
|
TeamCreateSubCommand --|> SubCommand
|
|
TeamDeleteSubCommand --|> SubCommand
|
|
TeamSetLeaderSubCommand --|> SubCommand
|
|
TeamScoreSubCommand --|> SubCommand
|
|
TeamAddSubCommand --|> SubCommand
|
|
TeamRemoveSubCommand --|> SubCommand
|
|
TeamTransferSubCommand --|> SubCommand
|
|
TeamVisibilitySubCommand --|> SubCommand
|
|
TeamSetSpawnSubCommand --|> SubCommand
|
|
TeamJoinSubCommand --|> SubCommand
|
|
TeamLeaveSubCommand --|> SubCommand
|
|
TeamInfoSubCommand --|> SubCommand
|
|
TeamListSubCommand --|> SubCommand
|
|
TeamTopSubCommand --|> SubCommand
|
|
|
|
CoreCommand "1" *-- "1" TeamGroupSubCommand : contains
|
|
TeamGroupSubCommand "1" *-- "14" SubCommand : contains
|
|
}
|
|
}
|
|
|
|
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")
|
|
.replaceSubCommand("create",
|
|
new MyCreate(svc));
|
|
end note
|
|
|
|
@enduml
|