refactor: split team/player/message into impl/ and exception/ subpackages
Each domain now has:
- Top-level package: contracts (interfaces, entities, enums, values, events).
- exception/ subpackage: exception hierarchy.
- impl/ subpackage: implementations CR-Core ships by default, swappable by
a game plugin if needed.
Moved (FQN changes for consumers):
- fr.luc.crcore.team.TeamException (+ AlreadyExists, NotFound, Access)
→ fr.luc.crcore.team.exception.*
- fr.luc.crcore.team.TeamServiceImpl, BukkitEventFiringTeamServiceImpl,
InMemoryTeamRepository, SqliteTeamRepository
→ fr.luc.crcore.team.impl.*
- fr.luc.crcore.player.PlayerException, PlayerProfileNotFoundException
→ fr.luc.crcore.player.exception.*
- fr.luc.crcore.player.PlayerProfileServiceImpl,
BukkitEventFiringPlayerProfileServiceImpl,
InMemoryPlayerProfileRepository, SqlitePlayerProfileRepository
→ fr.luc.crcore.player.impl.*
- fr.luc.crcore.message.YamlMessagesService
→ fr.luc.crcore.message.impl.YamlMessagesService
Unchanged top-level packages: database/, command/, common/ (already small
and well-organized). Events stay where they were (already in event/
subpackages).
setup.md tree updated to reflect the new layout. decisions.md logs the
rationale (consumer-facing FQNs, separation between contract and impl).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,15 +3,15 @@ package fr.luc.crcore;
|
||||
import fr.luc.crcore.command.builtin.CoreCommand;
|
||||
import fr.luc.crcore.database.Database;
|
||||
import fr.luc.crcore.message.MessagesService;
|
||||
import fr.luc.crcore.message.YamlMessagesService;
|
||||
import fr.luc.crcore.player.BukkitEventFiringPlayerProfileServiceImpl;
|
||||
import fr.luc.crcore.player.InMemoryPlayerProfileRepository;
|
||||
import fr.luc.crcore.message.impl.YamlMessagesService;
|
||||
import fr.luc.crcore.player.impl.BukkitEventFiringPlayerProfileServiceImpl;
|
||||
import fr.luc.crcore.player.impl.InMemoryPlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileService;
|
||||
import fr.luc.crcore.player.SqlitePlayerProfileRepository;
|
||||
import fr.luc.crcore.team.BukkitEventFiringTeamServiceImpl;
|
||||
import fr.luc.crcore.team.InMemoryTeamRepository;
|
||||
import fr.luc.crcore.team.SqliteTeamRepository;
|
||||
import fr.luc.crcore.player.impl.SqlitePlayerProfileRepository;
|
||||
import fr.luc.crcore.team.impl.BukkitEventFiringTeamServiceImpl;
|
||||
import fr.luc.crcore.team.impl.InMemoryTeamRepository;
|
||||
import fr.luc.crcore.team.impl.SqliteTeamRepository;
|
||||
import fr.luc.crcore.team.TeamRepository;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@@ -7,7 +7,7 @@ import fr.luc.crcore.command.SubCommand;
|
||||
import fr.luc.crcore.message.MessagesService;
|
||||
import fr.luc.crcore.team.Team;
|
||||
import fr.luc.crcore.team.TeamColor;
|
||||
import fr.luc.crcore.team.TeamException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import fr.luc.crcore.team.TeamVisibility;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -5,7 +5,7 @@ import fr.luc.crcore.command.CommandResult;
|
||||
import fr.luc.crcore.command.SubCommand;
|
||||
import fr.luc.crcore.message.MessagesService;
|
||||
import fr.luc.crcore.team.Team;
|
||||
import fr.luc.crcore.team.TeamException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
package fr.luc.crcore.message;
|
||||
package fr.luc.crcore.message.impl;
|
||||
import fr.luc.crcore.message.MessagesService;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.exception;
|
||||
|
||||
public class PlayerException extends RuntimeException {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.exception;
|
||||
|
||||
public class PlayerProfileNotFoundException extends PlayerException {
|
||||
|
||||
+7
-1
@@ -1,4 +1,10 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.impl;
|
||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
||||
import fr.luc.crcore.player.exception.PlayerException;
|
||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileService;
|
||||
import fr.luc.crcore.player.PlayerRanking;
|
||||
import fr.luc.crcore.player.PlayerProfile;
|
||||
|
||||
import fr.luc.crcore.player.event.PlayerProfileCreateEvent;
|
||||
import fr.luc.crcore.player.event.PlayerProfileDeleteEvent;
|
||||
+7
-1
@@ -1,4 +1,10 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.impl;
|
||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
||||
import fr.luc.crcore.player.exception.PlayerException;
|
||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileService;
|
||||
import fr.luc.crcore.player.PlayerRanking;
|
||||
import fr.luc.crcore.player.PlayerProfile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
+7
-1
@@ -1,4 +1,10 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.impl;
|
||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
||||
import fr.luc.crcore.player.exception.PlayerException;
|
||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileService;
|
||||
import fr.luc.crcore.player.PlayerRanking;
|
||||
import fr.luc.crcore.player.PlayerProfile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
+7
-1
@@ -1,4 +1,10 @@
|
||||
package fr.luc.crcore.player;
|
||||
package fr.luc.crcore.player.impl;
|
||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
||||
import fr.luc.crcore.player.exception.PlayerException;
|
||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
||||
import fr.luc.crcore.player.PlayerProfileService;
|
||||
import fr.luc.crcore.player.PlayerRanking;
|
||||
import fr.luc.crcore.player.PlayerProfile;
|
||||
|
||||
import fr.luc.crcore.database.ColumnType;
|
||||
import fr.luc.crcore.database.Database;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.exception;
|
||||
|
||||
public class TeamAccessException extends TeamException {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.exception;
|
||||
|
||||
public class TeamAlreadyExistsException extends TeamException {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.exception;
|
||||
|
||||
public class TeamException extends RuntimeException {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.exception;
|
||||
|
||||
public class TeamNotFoundException extends TeamException {
|
||||
|
||||
+13
-1
@@ -1,4 +1,16 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.impl;
|
||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamRepository;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import fr.luc.crcore.team.TeamRanking;
|
||||
import fr.luc.crcore.team.TeamVisibility;
|
||||
import fr.luc.crcore.team.TeamColor;
|
||||
import fr.luc.crcore.team.TeamRole;
|
||||
import fr.luc.crcore.team.TeamMember;
|
||||
import fr.luc.crcore.team.Team;
|
||||
|
||||
import fr.luc.crcore.team.event.PlayerJoinTeamEvent;
|
||||
import fr.luc.crcore.team.event.TeamCreateEvent;
|
||||
+13
-1
@@ -1,4 +1,16 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.impl;
|
||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamRepository;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import fr.luc.crcore.team.TeamRanking;
|
||||
import fr.luc.crcore.team.TeamVisibility;
|
||||
import fr.luc.crcore.team.TeamColor;
|
||||
import fr.luc.crcore.team.TeamRole;
|
||||
import fr.luc.crcore.team.TeamMember;
|
||||
import fr.luc.crcore.team.Team;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
+13
-1
@@ -1,4 +1,16 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.impl;
|
||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamRepository;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import fr.luc.crcore.team.TeamRanking;
|
||||
import fr.luc.crcore.team.TeamVisibility;
|
||||
import fr.luc.crcore.team.TeamColor;
|
||||
import fr.luc.crcore.team.TeamRole;
|
||||
import fr.luc.crcore.team.TeamMember;
|
||||
import fr.luc.crcore.team.Team;
|
||||
|
||||
import fr.luc.crcore.database.ColumnType;
|
||||
import fr.luc.crcore.database.Database;
|
||||
+13
-1
@@ -1,4 +1,16 @@
|
||||
package fr.luc.crcore.team;
|
||||
package fr.luc.crcore.team.impl;
|
||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
||||
import fr.luc.crcore.team.exception.TeamException;
|
||||
import fr.luc.crcore.team.TeamRepository;
|
||||
import fr.luc.crcore.team.TeamService;
|
||||
import fr.luc.crcore.team.TeamRanking;
|
||||
import fr.luc.crcore.team.TeamVisibility;
|
||||
import fr.luc.crcore.team.TeamColor;
|
||||
import fr.luc.crcore.team.TeamRole;
|
||||
import fr.luc.crcore.team.TeamMember;
|
||||
import fr.luc.crcore.team.Team;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
Reference in New Issue
Block a user