Commands:
- Drop all short aliases (c/i/t/j/vis/disband/...) — long names only.
- Every /core team <action> now has a crcore.team.<action> permission.
- Three-tier model:
* Admin (perm only): create, delete, setleader, score
* Chef (perm + chef-check in execute): add, remove, transfer, visibility, setspawn
* Player (perm): join, leave, info, list, top
- delete now takes <team> as argument (admin); no more chef-disband shortcut.
New /core team setleader <team> <player>:
- Admin assigns or replaces a team's leader.
- More permissive than transfer: target may not yet be a member (auto-add),
and works on leaderless teams.
Leaderless teams:
- Team.leaderId is now nullable.
- getLeaderId() and getLeader() return Optional<...>.
- hasLeader() and isLeader(UUID) helpers added.
- New constructors Team(id, name, tag, color [, visibility]) for leaderless.
- TeamService.createTeam overloads without leaderId.
- TeamService.setLeader(teamId, playerId): assigns/replaces leader (auto-adds
as member if needed). Fires TeamLeadershipTransferEvent with optional old.
- TeamLeadershipTransferEvent.getOldLeaderId() returns Optional<UUID>.
- SqliteTeamRepository: leader_id column no longer NOT NULL.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Uses <release>11</release> in maven-compiler-plugin (recommended over
source/target to guarantee bytecode and API surface match Java 11).
Code changes to drop Java 12-16 features:
- records (TeamRanking, PlayerRanking, internal tuples in
SqliteTeamRepository) become hand-written immutable classes; same
accessor names (rank()/team()/score()/...) so call sites are unchanged.
- instanceof X x pattern matching becomes classic instanceof + cast in
CommandContext.requirePlayer and Database.normalize.
- switch expressions with -> arrows become classic switch + break, or
if/else chains, in BaseCommand.handleResult, ArgumentTypes.BOOLEAN and
TeamScoreSubCommand.execute.
docs/setup.md, features.md and decisions.md updated to reflect Java 11.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CRCore.registerCommand() now falls back to dynamic registration via the
server's internal CommandMap (reflection on CraftServer.commandMap) when
the command is absent from the host plugin's plugin.yml. Game plugins can
now use CR-Core with zero plugin.yml changes — just instantiate CRCore.
If the command IS declared in plugin.yml, CR-Core detects it and uses
setExecutor/setTabCompleter as before.
pom.xml: distributionManagement targeting Gitea Packages
(https://gitea.luc-rival.fr/api/packages/admin/maven), plus
maven-source-plugin (3.3.0) and maven-javadoc-plugin (3.6.3) so each
mvn deploy publishes the main jar, a -sources.jar and a -javadoc.jar.
doclint=none on javadoc to tolerate partial doc.
docs/setup.md: clarifies that the commands: entry in plugin.yml is now
optional. docs/decisions.md: new decision logged for the dynamic
registration approach.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CRCore bootstrap class: one-line setup for game plugins (new CRCore(this).enable()).
Wires SQLite, services with event firing, and the /core command tree.
SQLite layer (fr.luc.crcore.database): Database wrapper exposing execute/update/
queryOne/query plus a fluent TableBuilder. ColumnType enum, RowMapper interface,
DatabaseException. Game plugins create their own tables in 2 lines via
db.table("foo").ifNotExists().column(...).create().
Repositories: SqliteTeamRepository and SqlitePlayerProfileRepository extend their
InMemory counterparts (write-through cache). 5 internal tables prefixed crcore_.
Command framework refactored for nested sub-commands: subcommand storage moved
from BaseCommand to AbstractCommand, recursive dispatch() and tabComplete(),
replaceSubCommand() for plugin overrides.
Default /core team commands (13 leaf sub-commands): create, delete, add, remove,
join, leave, info, list, transfer, visibility, score, top, setspawn. Each in its
own class under fr.luc.crcore.command.builtin.team, fully substitutable.
Bukkit events: 9 team events (Create/Dissolve/MemberAdd/MemberRemove/PlayerJoin/
LeadershipTransfer/VisibilityChange/ScoreChange/SpawnPointChange) + 3 player
events (ProfileCreate/Delete/ScoreChange). All post-only, non-cancellable.
BukkitEventFiringTeamServiceImpl and BukkitEventFiringPlayerProfileServiceImpl
override the on* hooks to call Bukkit.getPluginManager().callEvent.
JavaDoc on all new public classes and key existing ones. docs/, GEMINI.md and
PUML diagrams synced: new sections (built-in commands, events, database,
bootstrap), 4 new diagrams (builtin-commands, events, database, bootstrap-
sequence), and 7 new architecture decisions logged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pure Maven library for CR Minecraft game plugins, targeting Paper 1.16.5.
Common abstractions (fr.luc.crcore.common): Identifiable, Named, ScoreHolder,
AbstractEntity, Repository<T>.
Team domain (fr.luc.crcore.team): Team entity with name/tag/color/leader/
visibility (PUBLIC|PRIVATE)/members/scores/spawn point, TeamMember,
TeamRole/TeamColor/TeamVisibility enums, TeamRanking record, TeamService with
overridable hooks (factories, validations, lifecycle events), in-memory
repository, dedicated exception hierarchy.
Player domain (fr.luc.crcore.player): PlayerProfile with named scores per
player, PlayerProfileService with auto-creation, individual rankings,
exception hierarchy. Both Team and PlayerProfile implement ScoreHolder.
Command framework (fr.luc.crcore.command): Command interface,
AbstractCommand base, BaseCommand (CommandExecutor + TabCompleter), SubCommand,
CommandContext, CommandResult, ArgumentType<T> + ArgumentTypes catalogue
(STRING, INTEGER, DOUBLE, BOOLEAN, ONLINE_PLAYER, enumOf, choice).
Docs (docs/) is the single source of truth: README, setup, features,
decisions log, and 6 PlantUML diagrams (team class/sequence/activity/join,
player class, command class).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>