refactor: split util/ vs features/ + modular opt-in setupX() config
Package restructure to prepare future modularization. Three layers now:
1. fr.luc.crcore.util.* (always active)
- common, command framework, database, message, broadcast, gui,
placeholder
2. fr.luc.crcore.features.* (opt-in)
- team (entities, services, repos, events, exceptions, config + GUI,
command/Team*SubCommand)
- player (profile, ranking, services, repos, events, exceptions)
3. fr.luc.crcore.builtin.*
- CoreCommand + CoreReloadSubCommand (top-level routing — not a
feature, not an util)
FQN moves (game plugins importing these need their imports updated):
- fr.luc.crcore.common.* → fr.luc.crcore.util.common.*
- fr.luc.crcore.command.* → fr.luc.crcore.util.command.*
- fr.luc.crcore.command.builtin.team.*
→ fr.luc.crcore.features.team.command.*
- fr.luc.crcore.command.builtin.CoreCommand / CoreReloadSubCommand
→ fr.luc.crcore.builtin.*
- fr.luc.crcore.database.* → fr.luc.crcore.util.database.*
- fr.luc.crcore.message.* → fr.luc.crcore.util.message.*
- fr.luc.crcore.broadcast.* → fr.luc.crcore.util.broadcast.*
- fr.luc.crcore.gui.* → fr.luc.crcore.util.gui.*
- fr.luc.crcore.placeholder.* → fr.luc.crcore.util.placeholder.*
- fr.luc.crcore.team.* → fr.luc.crcore.features.team.*
- fr.luc.crcore.player.* → fr.luc.crcore.features.player.*
CRCoreConfig — features opt-in via fluent setup:
- setupTeams() enables team feature
- setupPlayers() enables player feature
- setupPlaceholders() enables PAPI integration
- setupAll() shortcut
By default no feature is active. Game plugin must opt-in.
CRCore.enable() now conditional:
- Util services always built (messages, broadcasts, gui listener).
- Team services + repos + config built only if setupTeams().
- Player services + repos built only if setupPlayers().
- Placeholder hook registered only if setupPlaceholders() (and PAPI
installed at runtime).
- Getters of disabled features throw IllegalStateException with a clear
message pointing to the missing setupX() call.
- CoreCommand only registers TeamGroupSubCommand if teamService and
teamConfig are non-null. CoreReloadSubCommand handles teamConfig=null
(just skips that reload). /core reload always available.
Docs:
- setup.md tree fully rewritten to reflect util/+features/+builtin
layout (~70 lines of arborescence).
- setup.md code snippet shows the three opt-in patterns (setupAll /
granular / with options).
- decisions.md logs both decisions (restructure + modular setup).
- All .puml diagrams auto-updated to new FQNs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -367,6 +367,70 @@ Format léger : une décision = un titre + contexte + choix + raison.
|
|||||||
bases existantes, ALTER TABLE manuel ou suppression du fichier
|
bases existantes, ALTER TABLE manuel ou suppression du fichier
|
||||||
(les bases d'event sont jetables).
|
(les bases d'event sont jetables).
|
||||||
|
|
||||||
|
## 2026-06-10 — Réorganisation : `util/` (toujours) vs `features/` (opt-in)
|
||||||
|
|
||||||
|
- **Choix** : séparation nette en deux couches :
|
||||||
|
- `fr.luc.crcore.util.*` — couche **utilitaire**, toujours active : common,
|
||||||
|
command framework, database, message, broadcast, gui, placeholder.
|
||||||
|
- `fr.luc.crcore.features.*` — couche **features**, opt-in : team, player.
|
||||||
|
- `fr.luc.crcore.builtin.*` — les commandes top-level CoreCommand +
|
||||||
|
CoreReloadSubCommand (pas un util, pas une feature, mais le routing
|
||||||
|
global).
|
||||||
|
- **Renames de FQN** (importer côté plugin de jeu si on les utilise) :
|
||||||
|
- `fr.luc.crcore.common.*` → `fr.luc.crcore.util.common.*`
|
||||||
|
- `fr.luc.crcore.command.*` → `fr.luc.crcore.util.command.*`
|
||||||
|
(le framework — Command, BaseCommand, SubCommand, ArgumentType…)
|
||||||
|
- `fr.luc.crcore.command.builtin.team.*`
|
||||||
|
→ `fr.luc.crcore.features.team.command.*`
|
||||||
|
(les 14+ Team*SubCommand)
|
||||||
|
- `fr.luc.crcore.command.builtin.CoreCommand` / `CoreReloadSubCommand`
|
||||||
|
→ `fr.luc.crcore.builtin.*`
|
||||||
|
- `fr.luc.crcore.database.*` → `fr.luc.crcore.util.database.*`
|
||||||
|
- `fr.luc.crcore.message.*` → `fr.luc.crcore.util.message.*`
|
||||||
|
- `fr.luc.crcore.broadcast.*` → `fr.luc.crcore.util.broadcast.*`
|
||||||
|
- `fr.luc.crcore.gui.*` → `fr.luc.crcore.util.gui.*`
|
||||||
|
- `fr.luc.crcore.placeholder.*` → `fr.luc.crcore.util.placeholder.*`
|
||||||
|
- `fr.luc.crcore.team.*` → `fr.luc.crcore.features.team.*`
|
||||||
|
(et sous-packages event/exception/impl/config)
|
||||||
|
- `fr.luc.crcore.player.*` → `fr.luc.crcore.features.player.*`
|
||||||
|
- **Raison** : prépare la modularisation à long terme. Chaque feature est
|
||||||
|
isolée dans son sous-package `features/<nom>/` et peut éventuellement
|
||||||
|
être extraite en module Maven séparé plus tard. Les utils sont
|
||||||
|
partagés. Le top-level reste minimal (CRCore, CRCoreConfig, builtin).
|
||||||
|
|
||||||
|
## 2026-06-10 — Setup modulaire via `CRCoreConfig.setupX()`
|
||||||
|
|
||||||
|
- **Choix** : les features sont désormais **opt-in**. Par défaut une
|
||||||
|
instance de `CRCoreConfig` n'active **aucune** feature ; le plugin de
|
||||||
|
jeu opt-in via :
|
||||||
|
- `setupTeams()` — active team service, repo, config + GUI, sous-cmds
|
||||||
|
- `setupPlayers()` — active player profile service + repo
|
||||||
|
- `setupPlaceholders()` — active la hook PAPI (no-op si PAPI absent)
|
||||||
|
- `setupAll()` — raccourci, active tout
|
||||||
|
- **Comportement quand off** : les getters de service (ex.
|
||||||
|
`core.getTeamService()`) lèvent `IllegalStateException` avec un
|
||||||
|
message explicite. Les commandes built-in correspondantes ne sont
|
||||||
|
simplement pas enregistrées (ex. `/core team` n'existe pas si teams
|
||||||
|
off).
|
||||||
|
- **Util toujours actif** : messages, broadcasts, GUI framework, command
|
||||||
|
framework, database sont systématiquement chargés. C'est la couche
|
||||||
|
infrastructure que les features et les game plugins consomment.
|
||||||
|
- **Listeners Bukkit toujours register** : `CRCoreBroadcastListener` et
|
||||||
|
`GuiListener` sont register unconditionnellement. Si aucune feature ne
|
||||||
|
tire d'event, ils sont idle — aucun coût.
|
||||||
|
- **Snippet d'usage** :
|
||||||
|
```java
|
||||||
|
this.core = new CRCore(this,
|
||||||
|
new CRCoreConfig().setupAll()).enable();
|
||||||
|
// ou granular :
|
||||||
|
this.core = new CRCore(this,
|
||||||
|
new CRCoreConfig().setupTeams()).enable();
|
||||||
|
```
|
||||||
|
- **Raison** : un game plugin qui n'a pas besoin des teams ne charge
|
||||||
|
pas le service ; pas de fichier `<plugin>-team-config.yml` créé, pas
|
||||||
|
de table `crcore_teams` créée, pas de sous-commande `/core team`. La
|
||||||
|
surface est minimale par défaut.
|
||||||
|
|
||||||
## 2026-06-10 — Settings d'équipe : cascade per-team → global → default + GUI
|
## 2026-06-10 — Settings d'équipe : cascade per-team → global → default + GUI
|
||||||
|
|
||||||
- **Choix** : nouveau module `fr.luc.crcore.team.config` avec :
|
- **Choix** : nouveau module `fr.luc.crcore.team.config` avec :
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — Broadcast service (class diagram)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.broadcast" {
|
package "fr.luc.crcore.util.broadcast" {
|
||||||
|
|
||||||
enum BroadcastAudience {
|
enum BroadcastAudience {
|
||||||
NONE
|
NONE
|
||||||
@@ -54,7 +54,7 @@ package "fr.luc.crcore.broadcast" {
|
|||||||
}
|
}
|
||||||
CRCoreBroadcastListener ..|> "org.bukkit.event.Listener"
|
CRCoreBroadcastListener ..|> "org.bukkit.event.Listener"
|
||||||
|
|
||||||
package "fr.luc.crcore.broadcast.impl" {
|
package "fr.luc.crcore.util.broadcast.impl" {
|
||||||
class YamlBroadcastService {
|
class YamlBroadcastService {
|
||||||
- plugin: JavaPlugin
|
- plugin: JavaPlugin
|
||||||
- messages: MessagesService
|
- messages: MessagesService
|
||||||
@@ -73,7 +73,7 @@ package "fr.luc.crcore.broadcast" {
|
|||||||
|
|
||||||
BroadcastService ..> BroadcastContext : consumes
|
BroadcastService ..> BroadcastContext : consumes
|
||||||
BroadcastContext --> BroadcastAudience
|
BroadcastContext --> BroadcastAudience
|
||||||
YamlBroadcastService --> "fr.luc.crcore.message.MessagesService" : reads templates
|
YamlBroadcastService --> "fr.luc.crcore.util.message.MessagesService" : reads templates
|
||||||
CRCoreBroadcastListener --> BroadcastService : delegates
|
CRCoreBroadcastListener --> BroadcastService : delegates
|
||||||
CRCoreBroadcastListener ..> BroadcastContext : builds
|
CRCoreBroadcastListener ..> BroadcastContext : builds
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ title CR-Core — Default /core team commands (admin / joueur)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.command" {
|
package "fr.luc.crcore.util.command" {
|
||||||
abstract class BaseCommand
|
abstract class BaseCommand
|
||||||
abstract class SubCommand
|
abstract class SubCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.command.builtin" {
|
package "fr.luc.crcore.builtin" {
|
||||||
|
|
||||||
class CoreCommand
|
class CoreCommand
|
||||||
CoreCommand --|> BaseCommand
|
CoreCommand --|> BaseCommand
|
||||||
|
|
||||||
package "fr.luc.crcore.command.builtin.team" {
|
package "fr.luc.crcore.features.team.command" {
|
||||||
|
|
||||||
class TeamGroupSubCommand {
|
class TeamGroupSubCommand {
|
||||||
+ TeamGroupSubCommand(service)
|
+ TeamGroupSubCommand(service)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — Command framework (class diagram, nested sub-commands)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.command" {
|
package "fr.luc.crcore.util.command" {
|
||||||
|
|
||||||
interface Command {
|
interface Command {
|
||||||
+ getName(): String
|
+ getName(): String
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — Database (SQLite wrapper)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.database" {
|
package "fr.luc.crcore.util.database" {
|
||||||
|
|
||||||
class Database {
|
class Database {
|
||||||
- connection: Connection
|
- connection: Connection
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ package "org.bukkit.event" {
|
|||||||
abstract class Event
|
abstract class Event
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.team.event" {
|
package "fr.luc.crcore.features.team.event" {
|
||||||
|
|
||||||
abstract class TeamEvent {
|
abstract class TeamEvent {
|
||||||
- team: Team
|
- team: Team
|
||||||
@@ -57,7 +57,7 @@ package "fr.luc.crcore.team.event" {
|
|||||||
TeamSpawnPointChangeEvent --|> TeamEvent
|
TeamSpawnPointChangeEvent --|> TeamEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.player.event" {
|
package "fr.luc.crcore.features.player.event" {
|
||||||
|
|
||||||
abstract class PlayerProfileEvent {
|
abstract class PlayerProfileEvent {
|
||||||
- profile: PlayerProfile
|
- profile: PlayerProfile
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — GUI framework (class diagram, réutilisable)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.gui" {
|
package "fr.luc.crcore.util.gui" {
|
||||||
|
|
||||||
abstract class AbstractInventoryGui {
|
abstract class AbstractInventoryGui {
|
||||||
- inventory: Inventory
|
- inventory: Inventory
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — Messages service (class diagram)
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.message" {
|
package "fr.luc.crcore.util.message" {
|
||||||
|
|
||||||
interface MessagesService {
|
interface MessagesService {
|
||||||
+ get(key, placeholderPairs...): String
|
+ get(key, placeholderPairs...): String
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ hide empty members
|
|||||||
|
|
||||||
' === Common abstractions ===
|
' === Common abstractions ===
|
||||||
|
|
||||||
package "fr.luc.crcore.common" {
|
package "fr.luc.crcore.util.common" {
|
||||||
|
|
||||||
interface Identifiable {
|
interface Identifiable {
|
||||||
+ getId(): UUID
|
+ getId(): UUID
|
||||||
@@ -40,7 +40,7 @@ package "fr.luc.crcore.common" {
|
|||||||
|
|
||||||
' === Player domain ===
|
' === Player domain ===
|
||||||
|
|
||||||
package "fr.luc.crcore.player" {
|
package "fr.luc.crcore.features.player" {
|
||||||
|
|
||||||
class PlayerProfile {
|
class PlayerProfile {
|
||||||
- scores: Map<String, Integer>
|
- scores: Map<String, Integer>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ hide empty members
|
|||||||
|
|
||||||
' === Common abstractions ===
|
' === Common abstractions ===
|
||||||
|
|
||||||
package "fr.luc.crcore.common" {
|
package "fr.luc.crcore.util.common" {
|
||||||
|
|
||||||
interface Identifiable {
|
interface Identifiable {
|
||||||
+ getId(): UUID
|
+ getId(): UUID
|
||||||
@@ -47,7 +47,7 @@ package "fr.luc.crcore.common" {
|
|||||||
|
|
||||||
' === Team domain ===
|
' === Team domain ===
|
||||||
|
|
||||||
package "fr.luc.crcore.team" {
|
package "fr.luc.crcore.features.team" {
|
||||||
|
|
||||||
enum TeamRole {
|
enum TeamRole {
|
||||||
LEADER
|
LEADER
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title CR-Core — Team config (class diagram, cascade per-team → global → de
|
|||||||
skinparam classAttributeIconSize 0
|
skinparam classAttributeIconSize 0
|
||||||
hide empty members
|
hide empty members
|
||||||
|
|
||||||
package "fr.luc.crcore.team.config" {
|
package "fr.luc.crcore.features.team.config" {
|
||||||
|
|
||||||
class "TeamSetting<T>" as TeamSetting <<final>> {
|
class "TeamSetting<T>" as TeamSetting <<final>> {
|
||||||
- key: String
|
- key: String
|
||||||
@@ -60,7 +60,7 @@ package "fr.luc.crcore.team.config" {
|
|||||||
+ getGlobalFileName(): Optional<String>
|
+ getGlobalFileName(): Optional<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.team.config.impl" {
|
package "fr.luc.crcore.features.team.config.impl" {
|
||||||
class YamlTeamConfigService {
|
class YamlTeamConfigService {
|
||||||
- plugin: JavaPlugin
|
- plugin: JavaPlugin
|
||||||
- teamRepository: TeamRepository
|
- teamRepository: TeamRepository
|
||||||
@@ -77,14 +77,14 @@ package "fr.luc.crcore.team.config" {
|
|||||||
TeamConfigService ..> TeamSetting : reads/writes
|
TeamConfigService ..> TeamSetting : reads/writes
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.team" {
|
package "fr.luc.crcore.features.team" {
|
||||||
class Team {
|
class Team {
|
||||||
- settings: Map<String, Object>
|
- settings: Map<String, Object>
|
||||||
+ getSettings(): Map<String, Object>
|
+ getSettings(): Map<String, Object>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
package "fr.luc.crcore.team.config.gui" {
|
package "fr.luc.crcore.features.team.config.gui" {
|
||||||
abstract class AbstractSettingsGui {
|
abstract class AbstractSettingsGui {
|
||||||
- rebuild() : peint la grille
|
- rebuild() : peint la grille
|
||||||
# {abstract} getCurrentValue(setting): T
|
# {abstract} getCurrentValue(setting): T
|
||||||
@@ -96,14 +96,14 @@ package "fr.luc.crcore.team.config.gui" {
|
|||||||
class TeamSettingsGui
|
class TeamSettingsGui
|
||||||
GlobalSettingsGui --|> AbstractSettingsGui
|
GlobalSettingsGui --|> AbstractSettingsGui
|
||||||
TeamSettingsGui --|> AbstractSettingsGui
|
TeamSettingsGui --|> AbstractSettingsGui
|
||||||
AbstractSettingsGui --|> "fr.luc.crcore.gui.AbstractInventoryGui"
|
AbstractSettingsGui --|> "fr.luc.crcore.util.gui.AbstractInventoryGui"
|
||||||
|
|
||||||
GlobalSettingsGui --> TeamConfigService
|
GlobalSettingsGui --> TeamConfigService
|
||||||
TeamSettingsGui --> TeamConfigService
|
TeamSettingsGui --> TeamConfigService
|
||||||
TeamSettingsGui --> Team
|
TeamSettingsGui --> Team
|
||||||
}
|
}
|
||||||
|
|
||||||
YamlTeamConfigService --> "fr.luc.crcore.team.TeamRepository" : persists per-team via save()
|
YamlTeamConfigService --> "fr.luc.crcore.features.team.TeamRepository" : persists per-team via save()
|
||||||
TeamConfigService ..> Team : reads/writes settings map
|
TeamConfigService ..> Team : reads/writes settings map
|
||||||
|
|
||||||
note bottom of YamlTeamConfigService
|
note bottom of YamlTeamConfigService
|
||||||
|
|||||||
+97
-99
@@ -66,7 +66,12 @@ api-version: 1.16
|
|||||||
> Dans ce cas, CR-Core détecte la commande déclarée et s'y branche
|
> Dans ce cas, CR-Core détecte la commande déclarée et s'y branche
|
||||||
> normalement via `setExecutor` (pas d'enregistrement dynamique).
|
> normalement via `setExecutor` (pas d'enregistrement dynamique).
|
||||||
|
|
||||||
### Code minimal
|
### Code minimal — setup modulaire
|
||||||
|
|
||||||
|
> ⚠️ **Important** : depuis 2026-06-10, les features (teams, players,
|
||||||
|
> placeholders) sont **opt-in** via `CRCoreConfig.setupX()`. Une instance
|
||||||
|
> `new CRCoreConfig()` n'active rien par défaut — il faut appeler
|
||||||
|
> `setupAll()` ou les `setupX()` individuels.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public class MyGamePlugin extends JavaPlugin {
|
public class MyGamePlugin extends JavaPlugin {
|
||||||
@@ -75,13 +80,27 @@ public class MyGamePlugin extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// 1 ligne = SQLite + services + /core team ... opérationnels
|
// OPTION A — tout activer en une ligne (teams + players + placeholders)
|
||||||
this.core = new CRCore(this).enable();
|
this.core = new CRCore(this, new CRCoreConfig().setupAll()).enable();
|
||||||
|
|
||||||
// Listener custom sur les events team
|
// OPTION B — granularité, n'activer que ce qu'on veut
|
||||||
|
// this.core = new CRCore(this, new CRCoreConfig()
|
||||||
|
// .setupTeams()
|
||||||
|
// .setupPlaceholders()) // pas de players
|
||||||
|
// .enable();
|
||||||
|
|
||||||
|
// OPTION C — par défaut + options
|
||||||
|
// this.core = new CRCore(this, new CRCoreConfig()
|
||||||
|
// .withSqliteFile("mygame.db")
|
||||||
|
// .withCommandName("game")
|
||||||
|
// .setupTeams())
|
||||||
|
// .enable();
|
||||||
|
|
||||||
|
// Listener custom sur les events team (nécessite setupTeams)
|
||||||
getServer().getPluginManager().registerEvents(new MyTeamListener(), this);
|
getServer().getPluginManager().registerEvents(new MyTeamListener(), this);
|
||||||
|
|
||||||
// Table custom pour stocker des données spécifiques au jeu
|
// Table custom pour stocker des données spécifiques au jeu
|
||||||
|
// (database util est toujours disponible)
|
||||||
core.getDatabase().table("my_kills")
|
core.getDatabase().table("my_kills")
|
||||||
.ifNotExists()
|
.ifNotExists()
|
||||||
.column("player_id", ColumnType.UUID).primaryKey()
|
.column("player_id", ColumnType.UUID).primaryKey()
|
||||||
@@ -168,101 +187,80 @@ CitesPlugin/ # dossier IntelliJ (renommer plus t
|
|||||||
│ ├── decisions.md
|
│ ├── decisions.md
|
||||||
│ └── diagrams/*.puml
|
│ └── diagrams/*.puml
|
||||||
└── src/main/java/fr/luc/crcore/
|
└── src/main/java/fr/luc/crcore/
|
||||||
├── CRCore.java # bootstrap orchestrator
|
├── CRCore.java # bootstrap (setupAll/setupTeams/...)
|
||||||
├── CRCoreConfig.java # config (sqlite, command name, …)
|
├── CRCoreConfig.java # config builder + flags features
|
||||||
├── common/
|
├── builtin/ # commandes top-level (toutes features)
|
||||||
│ ├── Identifiable.java
|
│ ├── CoreCommand.java # /core
|
||||||
│ ├── Named.java
|
│ └── CoreReloadSubCommand.java # /core reload
|
||||||
│ ├── ScoreHolder.java # contrat partagé Team + PlayerProfile
|
├── util/ # ◆ couche util — toujours active ◆
|
||||||
│ ├── AbstractEntity.java
|
│ ├── common/ # abstractions partagées
|
||||||
│ └── Repository.java
|
│ │ ├── Identifiable.java
|
||||||
├── database/ # wrapper SQLite
|
│ │ ├── Named.java
|
||||||
│ ├── Database.java
|
│ │ ├── ScoreHolder.java
|
||||||
│ ├── TableBuilder.java
|
│ │ ├── AbstractEntity.java
|
||||||
│ ├── ColumnType.java
|
│ │ └── Repository.java
|
||||||
│ ├── RowMapper.java
|
│ ├── database/ # wrapper SQLite générique
|
||||||
│ └── DatabaseException.java
|
│ │ ├── Database.java
|
||||||
├── command/ # framework
|
│ │ ├── TableBuilder.java
|
||||||
│ ├── Command.java (interface)
|
│ │ ├── ColumnType.java
|
||||||
│ ├── AbstractCommand.java # base partagée, nested sub-commands
|
│ │ ├── RowMapper.java
|
||||||
│ ├── BaseCommand.java # top-level Bukkit-aware
|
│ │ └── DatabaseException.java
|
||||||
│ ├── SubCommand.java
|
│ ├── command/ # framework de commandes
|
||||||
│ ├── CommandContext.java
|
│ │ ├── Command.java (interface)
|
||||||
│ ├── CommandResult.java
|
│ │ ├── AbstractCommand.java
|
||||||
│ ├── CommandException.java
|
│ │ ├── BaseCommand.java
|
||||||
│ ├── ArgumentType.java
|
│ │ ├── SubCommand.java
|
||||||
│ ├── ArgumentTypes.java
|
│ │ ├── CommandContext.java
|
||||||
│ ├── ArgumentDef.java # package-private
|
│ │ ├── CommandResult.java
|
||||||
│ └── builtin/ # commandes prêtes à l'emploi
|
│ │ ├── CommandException.java
|
||||||
│ ├── CoreCommand.java # /core
|
│ │ ├── ArgumentType.java
|
||||||
│ └── team/
|
│ │ ├── ArgumentTypes.java
|
||||||
│ ├── TeamGroupSubCommand.java # /core team (container)
|
│ │ └── ArgumentDef.java (package-private)
|
||||||
│ ├── TeamArgumentTypes.java # ArgumentType<Team> avec tab-complete
|
│ ├── message/ # service messages YAML
|
||||||
│ ├── TeamCreateSubCommand.java # /core team create
|
│ │ ├── MessagesService.java
|
||||||
│ ├── TeamDeleteSubCommand.java # /core team delete
|
│ │ └── impl/YamlMessagesService.java
|
||||||
│ ├── TeamAddSubCommand.java # /core team add
|
│ ├── broadcast/ # service broadcasts YAML + listener
|
||||||
│ ├── TeamRemoveSubCommand.java # /core team remove
|
│ │ ├── BroadcastService.java
|
||||||
│ ├── TeamJoinSubCommand.java # /core team join
|
│ │ ├── BroadcastAudience.java
|
||||||
│ ├── TeamLeaveSubCommand.java # /core team leave
|
│ │ ├── BroadcastContext.java
|
||||||
│ ├── TeamInfoSubCommand.java # /core team info
|
│ │ ├── CRCoreBroadcastListener.java
|
||||||
│ ├── TeamListSubCommand.java # /core team list
|
│ │ └── impl/YamlBroadcastService.java
|
||||||
│ ├── TeamTransferSubCommand.java # /core team transfer
|
│ ├── gui/ # framework GUI (InventoryHolder)
|
||||||
│ ├── TeamVisibilitySubCommand.java # /core team visibility
|
│ │ ├── AbstractInventoryGui.java
|
||||||
│ ├── TeamScoreSubCommand.java # /core team score (admin)
|
│ │ ├── GuiClickHandler.java
|
||||||
│ ├── TeamTopSubCommand.java # /core team top
|
│ │ ├── GuiListener.java
|
||||||
│ └── TeamSetSpawnSubCommand.java # /core team setspawn
|
│ │ └── GuiItems.java
|
||||||
├── message/ # service de messages YAML
|
│ └── placeholder/ # PAPI expansion (opt-in)
|
||||||
│ ├── MessagesService.java # interface (contrat public)
|
│ └── CRCorePlaceholderExpansion.java
|
||||||
│ └── impl/
|
└── features/ # ◆ features opt-in via setupX() ◆
|
||||||
│ └── YamlMessagesService.java # impl par défaut
|
├── team/ (setupTeams())
|
||||||
├── team/ # contrats + entités au top
|
│ ├── Team.java, TeamMember, enums, TeamRanking
|
||||||
│ ├── Team.java # entité
|
│ ├── TeamService.java (interface)
|
||||||
│ ├── TeamMember.java # entité
|
│ ├── TeamRepository.java (interface)
|
||||||
│ ├── TeamRole.java # enum
|
│ ├── event/ (9 events Bukkit)
|
||||||
│ ├── TeamColor.java # enum
|
│ ├── exception/ (4 exceptions)
|
||||||
│ ├── TeamVisibility.java # enum
|
│ ├── impl/ (TeamServiceImpl, BukkitEventFiring*, InMemory*, Sqlite*)
|
||||||
│ ├── TeamRanking.java # value
|
│ ├── config/ (settings typés)
|
||||||
│ ├── TeamService.java # interface
|
│ │ ├── TeamSetting.java
|
||||||
│ ├── TeamRepository.java # interface
|
│ │ ├── TeamSettings.java (registry)
|
||||||
│ ├── event/ # Bukkit events team
|
│ │ ├── TeamConfigService.java
|
||||||
│ │ ├── TeamEvent.java # base
|
│ │ ├── impl/YamlTeamConfigService.java
|
||||||
│ │ ├── TeamCreateEvent.java
|
│ │ └── gui/ (Global + TeamSettingsGui)
|
||||||
│ │ ├── TeamDissolveEvent.java
|
│ │ ├── AbstractSettingsGui.java
|
||||||
│ │ ├── TeamMemberAddEvent.java
|
│ │ ├── GlobalSettingsGui.java
|
||||||
│ │ ├── TeamMemberRemoveEvent.java
|
│ │ └── TeamSettingsGui.java
|
||||||
│ │ ├── PlayerJoinTeamEvent.java
|
│ └── command/ (14 sous-commandes /core team)
|
||||||
│ │ ├── TeamLeadershipTransferEvent.java
|
│ ├── TeamGroupSubCommand.java
|
||||||
│ │ ├── TeamVisibilityChangeEvent.java
|
│ ├── TeamArgumentTypes.java
|
||||||
│ │ ├── TeamScoreChangeEvent.java
|
│ └── Team*SubCommand.java
|
||||||
│ │ └── TeamSpawnPointChangeEvent.java
|
└── player/ (setupPlayers())
|
||||||
│ ├── exception/ # hiérarchie d'exceptions team
|
├── PlayerProfile.java
|
||||||
│ │ ├── TeamException.java # base
|
├── PlayerRanking.java
|
||||||
│ │ ├── TeamAlreadyExistsException.java
|
├── PlayerProfileService.java (interface)
|
||||||
│ │ ├── TeamNotFoundException.java
|
├── PlayerProfileRepository.java (interface)
|
||||||
│ │ └── TeamAccessException.java
|
├── event/ (3 events)
|
||||||
│ └── impl/ # implémentations swappables
|
├── exception/ (2 exceptions)
|
||||||
│ ├── TeamServiceImpl.java # service de base
|
└── impl/ (services + repositories)
|
||||||
│ ├── BukkitEventFiringTeamServiceImpl.java # impl par défaut
|
|
||||||
│ ├── InMemoryTeamRepository.java # repo en mémoire
|
|
||||||
│ └── SqliteTeamRepository.java # repo SQLite write-through
|
|
||||||
└── player/ # contrats + entités au top
|
|
||||||
├── PlayerProfile.java # entité
|
|
||||||
├── PlayerRanking.java # value
|
|
||||||
├── PlayerProfileService.java # interface
|
|
||||||
├── PlayerProfileRepository.java # interface
|
|
||||||
├── event/ # Bukkit events player
|
|
||||||
│ ├── PlayerProfileEvent.java
|
|
||||||
│ ├── PlayerProfileCreateEvent.java
|
|
||||||
│ ├── PlayerProfileDeleteEvent.java
|
|
||||||
│ └── PlayerScoreChangeEvent.java
|
|
||||||
├── exception/
|
|
||||||
│ ├── PlayerException.java
|
|
||||||
│ └── PlayerProfileNotFoundException.java
|
|
||||||
└── impl/
|
|
||||||
├── PlayerProfileServiceImpl.java
|
|
||||||
├── BukkitEventFiringPlayerProfileServiceImpl.java
|
|
||||||
├── InMemoryPlayerProfileRepository.java
|
|
||||||
└── SqlitePlayerProfileRepository.java
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fichiers de config générés au premier `enable()`
|
## Fichiers de config générés au premier `enable()`
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
package fr.luc.crcore;
|
package fr.luc.crcore;
|
||||||
|
|
||||||
import fr.luc.crcore.broadcast.BroadcastService;
|
import fr.luc.crcore.builtin.CoreCommand;
|
||||||
import fr.luc.crcore.broadcast.CRCoreBroadcastListener;
|
import fr.luc.crcore.features.player.PlayerProfileRepository;
|
||||||
import fr.luc.crcore.broadcast.impl.YamlBroadcastService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.command.builtin.CoreCommand;
|
import fr.luc.crcore.features.player.impl.BukkitEventFiringPlayerProfileServiceImpl;
|
||||||
import fr.luc.crcore.database.Database;
|
import fr.luc.crcore.features.player.impl.InMemoryPlayerProfileRepository;
|
||||||
import fr.luc.crcore.gui.GuiListener;
|
import fr.luc.crcore.features.player.impl.SqlitePlayerProfileRepository;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.message.impl.YamlMessagesService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.team.config.impl.YamlTeamConfigService;
|
import fr.luc.crcore.features.team.config.impl.YamlTeamConfigService;
|
||||||
import fr.luc.crcore.player.impl.BukkitEventFiringPlayerProfileServiceImpl;
|
import fr.luc.crcore.features.team.impl.BukkitEventFiringTeamServiceImpl;
|
||||||
import fr.luc.crcore.player.impl.InMemoryPlayerProfileRepository;
|
import fr.luc.crcore.features.team.impl.InMemoryTeamRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
import fr.luc.crcore.features.team.impl.SqliteTeamRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.util.broadcast.BroadcastService;
|
||||||
import fr.luc.crcore.player.impl.SqlitePlayerProfileRepository;
|
import fr.luc.crcore.util.broadcast.CRCoreBroadcastListener;
|
||||||
import fr.luc.crcore.team.impl.BukkitEventFiringTeamServiceImpl;
|
import fr.luc.crcore.util.broadcast.impl.YamlBroadcastService;
|
||||||
import fr.luc.crcore.team.impl.InMemoryTeamRepository;
|
import fr.luc.crcore.util.database.Database;
|
||||||
import fr.luc.crcore.team.impl.SqliteTeamRepository;
|
import fr.luc.crcore.util.gui.GuiListener;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.util.message.impl.YamlMessagesService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandMap;
|
import org.bukkit.command.CommandMap;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -35,15 +35,18 @@ import java.util.Objects;
|
|||||||
/**
|
/**
|
||||||
* Point d'entrée unique de CR-Core pour un plugin de jeu downstream.
|
* Point d'entrée unique de CR-Core pour un plugin de jeu downstream.
|
||||||
*
|
*
|
||||||
* <p>Instanciée une fois dans {@code onEnable()}, branche en cascade :
|
* <p>Instancié une fois dans {@code onEnable()}, branche en cascade :
|
||||||
* <ol>
|
* <ol>
|
||||||
* <li>la base SQLite (dans le dataFolder du plugin),</li>
|
* <li>la base SQLite (toujours, si activée),</li>
|
||||||
* <li>les repositories (SQLite ou in-memory selon {@link CRCoreConfig}),</li>
|
* <li>les services <b>util</b> (messages, broadcasts, GUI) — toujours,</li>
|
||||||
* <li>les services team + player avec fire d'évènements Bukkit,</li>
|
* <li>les <b>features</b> activées via {@link CRCoreConfig#setupTeams()},
|
||||||
* <li>la commande {@code /core} avec tous ses sous-commandes par défaut.</li>
|
* {@link CRCoreConfig#setupPlayers()},
|
||||||
|
* {@link CRCoreConfig#setupPlaceholders()} (rien par défaut),</li>
|
||||||
|
* <li>la commande {@code /core} avec ses sous-commandes (uniquement
|
||||||
|
* celles des features actives).</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*
|
*
|
||||||
* <h2>Utilisation minimale côté plugin de jeu</h2>
|
* <h2>Utilisation côté plugin de jeu</h2>
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* public class MyGamePlugin extends JavaPlugin {
|
* public class MyGamePlugin extends JavaPlugin {
|
||||||
*
|
*
|
||||||
@@ -51,8 +54,9 @@ import java.util.Objects;
|
|||||||
*
|
*
|
||||||
* @Override
|
* @Override
|
||||||
* public void onEnable() {
|
* public void onEnable() {
|
||||||
* this.core = new CRCore(this).enable();
|
* this.core = new CRCore(this,
|
||||||
* // /core team create/delete/add/remove/join/leave/... est prêt
|
* new CRCoreConfig().setupAll()) // toutes les features
|
||||||
|
* .enable();
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* @Override
|
* @Override
|
||||||
@@ -62,18 +66,13 @@ import java.util.Objects;
|
|||||||
* }
|
* }
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* <p>Le plugin de jeu doit avoir déclaré la commande dans son {@code plugin.yml} :
|
* <p>Voir {@link CRCoreConfig} pour activer les features granulairement.
|
||||||
* <pre>{@code
|
|
||||||
* commands:
|
|
||||||
* core:
|
|
||||||
* description: Commandes CR-Core
|
|
||||||
* }</pre>
|
|
||||||
*
|
*
|
||||||
* <h2>Override</h2>
|
* <h2>Override</h2>
|
||||||
* Tout est accessible via les getters : {@link #getTeamService()},
|
* Tout est accessible via les getters (qui lèvent
|
||||||
* {@link #getCoreCommand()}, {@link #getDatabase()}, etc. Pour remplacer une
|
* {@link IllegalStateException} si la feature n'est pas activée). Pour
|
||||||
* sous-commande, voir {@link CoreCommand}. Pour remplacer un service complet,
|
* remplacer un service, sous-classer {@code CRCore} et override
|
||||||
* sous-classer {@code CRCore} et override {@link #buildTeamService}.
|
* {@link #buildTeamService}, {@link #buildPlayerProfileService}, etc.
|
||||||
*/
|
*/
|
||||||
public class CRCore {
|
public class CRCore {
|
||||||
|
|
||||||
@@ -81,17 +80,21 @@ public class CRCore {
|
|||||||
private final CRCoreConfig config;
|
private final CRCoreConfig config;
|
||||||
|
|
||||||
private Database database;
|
private Database database;
|
||||||
private TeamRepository teamRepository;
|
// Util — toujours initialisés
|
||||||
private TeamService teamService;
|
|
||||||
private PlayerProfileRepository playerProfileRepository;
|
|
||||||
private PlayerProfileService playerProfileService;
|
|
||||||
private MessagesService messages;
|
private MessagesService messages;
|
||||||
private BroadcastService broadcasts;
|
private BroadcastService broadcasts;
|
||||||
|
// Features team
|
||||||
|
private TeamRepository teamRepository;
|
||||||
|
private TeamService teamService;
|
||||||
private TeamConfigService teamConfig;
|
private TeamConfigService teamConfig;
|
||||||
|
// Features player
|
||||||
|
private PlayerProfileRepository playerProfileRepository;
|
||||||
|
private PlayerProfileService playerProfileService;
|
||||||
|
// Command routing
|
||||||
private CoreCommand coreCommand;
|
private CoreCommand coreCommand;
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
/** Construit CR-Core avec la config par défaut (SQLite activée, commande "core"). */
|
/** Construit CR-Core avec la config par défaut (rien d'activé — opt-in via setupX()). */
|
||||||
public CRCore(JavaPlugin plugin) {
|
public CRCore(JavaPlugin plugin) {
|
||||||
this(plugin, new CRCoreConfig());
|
this(plugin, new CRCoreConfig());
|
||||||
}
|
}
|
||||||
@@ -102,56 +105,68 @@ public class CRCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Branche tout : ouvre la DB, instancie les services, enregistre la
|
* Branche tout selon la config. Idempotent : un second appel est no-op.
|
||||||
* commande. Idempotent : un second appel est no-op.
|
|
||||||
*
|
*
|
||||||
* @return {@code this} pour chaîner.
|
* @return {@code this} pour chaîner.
|
||||||
*/
|
*/
|
||||||
public CRCore enable() {
|
public CRCore enable() {
|
||||||
if (enabled) return this;
|
if (enabled) return this;
|
||||||
|
|
||||||
|
// ---- 1. Database (util, toujours si setupAll/X) ----
|
||||||
if (config.isSqliteEnabled()) {
|
if (config.isSqliteEnabled()) {
|
||||||
File dbFile = new File(plugin.getDataFolder(), config.getSqliteFilename());
|
File dbFile = new File(plugin.getDataFolder(), config.getSqliteFilename());
|
||||||
if (!dbFile.getParentFile().exists() && !dbFile.getParentFile().mkdirs()) {
|
if (!dbFile.getParentFile().exists() && !dbFile.getParentFile().mkdirs()) {
|
||||||
plugin.getLogger().warning("Impossible de créer le dataFolder : " + dbFile.getParentFile());
|
plugin.getLogger().warning("Impossible de créer le dataFolder : " + dbFile.getParentFile());
|
||||||
}
|
}
|
||||||
this.database = new Database(dbFile);
|
this.database = new Database(dbFile);
|
||||||
this.teamRepository = new SqliteTeamRepository(database);
|
|
||||||
this.playerProfileRepository = new SqlitePlayerProfileRepository(database);
|
|
||||||
} else {
|
|
||||||
this.teamRepository = new InMemoryTeamRepository();
|
|
||||||
this.playerProfileRepository = new InMemoryPlayerProfileRepository();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.teamService = buildTeamService(teamRepository);
|
// ---- 2. Util services (toujours) ----
|
||||||
this.playerProfileService = buildPlayerProfileService(playerProfileRepository);
|
|
||||||
|
|
||||||
this.messages = buildMessagesService();
|
this.messages = buildMessagesService();
|
||||||
this.broadcasts = buildBroadcastService(messages);
|
this.broadcasts = buildBroadcastService(messages);
|
||||||
this.teamConfig = buildTeamConfigService(teamRepository);
|
|
||||||
|
|
||||||
// Listeners Bukkit : broadcasts (events CR-Core) + GUI (inventory clicks/close).
|
// ---- 3. Features (opt-in) ----
|
||||||
|
if (config.isTeamsEnabled()) {
|
||||||
|
this.teamRepository = (database != null)
|
||||||
|
? new SqliteTeamRepository(database)
|
||||||
|
: new InMemoryTeamRepository();
|
||||||
|
this.teamService = buildTeamService(teamRepository);
|
||||||
|
this.teamConfig = buildTeamConfigService(teamRepository);
|
||||||
|
}
|
||||||
|
if (config.isPlayersEnabled()) {
|
||||||
|
this.playerProfileRepository = (database != null)
|
||||||
|
? new SqlitePlayerProfileRepository(database)
|
||||||
|
: new InMemoryPlayerProfileRepository();
|
||||||
|
this.playerProfileService = buildPlayerProfileService(playerProfileRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- 4. Listeners Bukkit ----
|
||||||
|
// Broadcast listener : écoute les events team + player. S'il n'y a aucune
|
||||||
|
// feature qui les tire, il sera idle — pas de mal.
|
||||||
new CRCoreBroadcastListener(broadcasts).registerOn(plugin);
|
new CRCoreBroadcastListener(broadcasts).registerOn(plugin);
|
||||||
|
// GUI listener : toujours, le framework GUI est util.
|
||||||
new GuiListener().registerOn(plugin);
|
new GuiListener().registerOn(plugin);
|
||||||
|
|
||||||
this.coreCommand = buildCoreCommand(teamService, playerProfileService, messages, broadcasts, teamConfig);
|
// ---- 5. Command routing ----
|
||||||
|
this.coreCommand = buildCoreCommand();
|
||||||
registerCommand();
|
registerCommand();
|
||||||
|
|
||||||
registerPlaceholderHook();
|
// ---- 6. PlaceholderAPI (opt-in + conditionnel PAPI installé) ----
|
||||||
|
if (config.isPlaceholdersEnabled()) {
|
||||||
|
registerPlaceholderHook();
|
||||||
|
}
|
||||||
|
|
||||||
plugin.getLogger().info("CR-Core activé.");
|
plugin.getLogger().info("CR-Core activé"
|
||||||
|
+ " (teams=" + config.isTeamsEnabled()
|
||||||
|
+ ", players=" + config.isPlayersEnabled()
|
||||||
|
+ ", placeholders=" + config.isPlaceholdersEnabled() + ").");
|
||||||
enabled = true;
|
enabled = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enregistre l'expansion PlaceholderAPI {@code %crcore_*%} si le plugin
|
* Enregistre l'expansion PlaceholderAPI {@code %crcore_*%} si PAPI est
|
||||||
* PAPI est installé sur le serveur. Si absent, no-op silencieux — la
|
* installé. No-op silencieux sinon.
|
||||||
* lib reste fonctionnelle sans.
|
|
||||||
*
|
|
||||||
* <p>Le chargement de la classe d'expansion est différé via une indirection
|
|
||||||
* (méthode {@code doRegisterPlaceholderHook}) pour que le bytecode
|
|
||||||
* référençant {@code me.clip.placeholderapi.*} ne soit pas vérifié si
|
|
||||||
* PAPI n'est pas présent.
|
|
||||||
*/
|
*/
|
||||||
protected void registerPlaceholderHook() {
|
protected void registerPlaceholderHook() {
|
||||||
if (plugin.getServer().getPluginManager().getPlugin("PlaceholderAPI") == null) {
|
if (plugin.getServer().getPluginManager().getPlugin("PlaceholderAPI") == null) {
|
||||||
@@ -166,9 +181,9 @@ public class CRCore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Indirection pour différer le chargement des classes PAPI (cf. {@link #registerPlaceholderHook}). */
|
/** Indirection pour différer le chargement des classes PAPI. */
|
||||||
private void doRegisterPlaceholderHook() {
|
private void doRegisterPlaceholderHook() {
|
||||||
new fr.luc.crcore.placeholder.CRCorePlaceholderExpansion(
|
new fr.luc.crcore.util.placeholder.CRCorePlaceholderExpansion(
|
||||||
teamService, playerProfileService, plugin.getDescription().getVersion()
|
teamService, playerProfileService, plugin.getDescription().getVersion()
|
||||||
).register();
|
).register();
|
||||||
}
|
}
|
||||||
@@ -189,53 +204,38 @@ public class CRCore {
|
|||||||
|
|
||||||
// ---- Override points ----
|
// ---- Override points ----
|
||||||
|
|
||||||
/** Construit le {@link TeamService}. Override pour utiliser une impl custom. */
|
|
||||||
protected TeamService buildTeamService(TeamRepository repository) {
|
protected TeamService buildTeamService(TeamRepository repository) {
|
||||||
return new BukkitEventFiringTeamServiceImpl(plugin, repository);
|
return new BukkitEventFiringTeamServiceImpl(plugin, repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Construit le {@link PlayerProfileService}. Override pour une impl custom. */
|
|
||||||
protected PlayerProfileService buildPlayerProfileService(PlayerProfileRepository repository) {
|
protected PlayerProfileService buildPlayerProfileService(PlayerProfileRepository repository) {
|
||||||
return new BukkitEventFiringPlayerProfileServiceImpl(plugin, repository);
|
return new BukkitEventFiringPlayerProfileServiceImpl(plugin, repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Construit le {@link CoreCommand}. Override pour ajouter des groupes top-level. */
|
|
||||||
protected CoreCommand buildCoreCommand(TeamService teamService,
|
|
||||||
PlayerProfileService playerProfileService,
|
|
||||||
MessagesService messages,
|
|
||||||
BroadcastService broadcasts,
|
|
||||||
TeamConfigService teamConfig) {
|
|
||||||
return new CoreCommand(teamService, playerProfileService, messages, broadcasts, teamConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Construit le {@link TeamConfigService}. Override pour utiliser une impl custom. */
|
|
||||||
protected TeamConfigService buildTeamConfigService(TeamRepository repository) {
|
|
||||||
return new YamlTeamConfigService(plugin, repository);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Construit le {@link MessagesService}. Override pour utiliser une impl custom. */
|
|
||||||
protected MessagesService buildMessagesService() {
|
protected MessagesService buildMessagesService() {
|
||||||
return new YamlMessagesService(plugin);
|
return new YamlMessagesService(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Construit le {@link BroadcastService}. Override pour utiliser une impl custom. */
|
|
||||||
protected BroadcastService buildBroadcastService(MessagesService messages) {
|
protected BroadcastService buildBroadcastService(MessagesService messages) {
|
||||||
return new YamlBroadcastService(plugin, messages);
|
return new YamlBroadcastService(plugin, messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected TeamConfigService buildTeamConfigService(TeamRepository repository) {
|
||||||
* Enregistre {@link #coreCommand} sous le nom configuré, avec fallback
|
return new YamlTeamConfigService(plugin, repository);
|
||||||
* dynamique. Stratégie :
|
}
|
||||||
* <ol>
|
|
||||||
* <li>Si la commande est déclarée dans le {@code plugin.yml} du plugin
|
/** Construit le {@link CoreCommand} avec les services des features activées. */
|
||||||
* hôte ({@code plugin.getCommand(name)} non null), on s'y branche
|
protected CoreCommand buildCoreCommand() {
|
||||||
* classiquement via {@code setExecutor} / {@code setTabCompleter}.</li>
|
return new CoreCommand(
|
||||||
* <li>Sinon, on l'enregistre <b>dynamiquement</b> via le
|
config.isTeamsEnabled() ? teamService : null,
|
||||||
* {@link CommandMap} interne du serveur (accédé par réflexion sur
|
config.isPlayersEnabled() ? playerProfileService : null,
|
||||||
* le champ {@code commandMap} de {@code CraftServer}). Le plugin
|
messages,
|
||||||
* hôte n'a alors rien à mettre dans son {@code plugin.yml}.</li>
|
broadcasts,
|
||||||
* </ol>
|
config.isTeamsEnabled() ? teamConfig : null);
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
// ---- Command registration (plugin.yml ou CommandMap dynamique) ----
|
||||||
|
|
||||||
private void registerCommand() {
|
private void registerCommand() {
|
||||||
String name = config.getCommandName();
|
String name = config.getCommandName();
|
||||||
PluginCommand cmd = plugin.getCommand(name);
|
PluginCommand cmd = plugin.getCommand(name);
|
||||||
@@ -247,12 +247,6 @@ public class CRCore {
|
|||||||
registerDynamicCommand(name);
|
registerDynamicCommand(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Enregistre la commande sans entrée plugin.yml en passant par le
|
|
||||||
* {@link CommandMap} interne du serveur. Wrappe le {@link CoreCommand}
|
|
||||||
* dans une {@link org.bukkit.command.Command} anonyme qui délègue à
|
|
||||||
* {@code onCommand} / {@code onTabComplete}.
|
|
||||||
*/
|
|
||||||
private void registerDynamicCommand(String name) {
|
private void registerDynamicCommand(String name) {
|
||||||
try {
|
try {
|
||||||
CommandMap commandMap = resolveCommandMap();
|
CommandMap commandMap = resolveCommandMap();
|
||||||
@@ -278,10 +272,6 @@ public class CRCore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Récupère le {@link CommandMap} interne du serveur via réflexion sur
|
|
||||||
* {@code CraftServer.commandMap}. Stable sur Paper 1.16.5.
|
|
||||||
*/
|
|
||||||
private CommandMap resolveCommandMap() throws ReflectiveOperationException {
|
private CommandMap resolveCommandMap() throws ReflectiveOperationException {
|
||||||
Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
|
Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
@@ -292,17 +282,64 @@ public class CRCore {
|
|||||||
|
|
||||||
public JavaPlugin getPlugin() { return plugin; }
|
public JavaPlugin getPlugin() { return plugin; }
|
||||||
public CRCoreConfig getConfig() { return config; }
|
public CRCoreConfig getConfig() { return config; }
|
||||||
public Database getDatabase() { return database; }
|
|
||||||
public TeamRepository getTeamRepository() { return teamRepository; }
|
public Database getDatabase() {
|
||||||
public TeamService getTeamService() { return teamService; }
|
if (database == null) {
|
||||||
public PlayerProfileRepository getPlayerProfileRepository() { return playerProfileRepository; }
|
throw new IllegalStateException("Database is disabled (config.withInMemoryStorage()).");
|
||||||
public PlayerProfileService getPlayerProfileService() { return playerProfileService; }
|
}
|
||||||
|
return database;
|
||||||
|
}
|
||||||
|
|
||||||
public MessagesService getMessages() { return messages; }
|
public MessagesService getMessages() { return messages; }
|
||||||
public MessagesService messages() { return messages; }
|
public MessagesService messages() { return messages; }
|
||||||
public BroadcastService getBroadcasts() { return broadcasts; }
|
public BroadcastService getBroadcasts() { return broadcasts; }
|
||||||
public BroadcastService broadcasts() { return broadcasts; }
|
public BroadcastService broadcasts() { return broadcasts; }
|
||||||
public TeamConfigService getTeamConfig() { return teamConfig; }
|
|
||||||
public TeamConfigService teamConfig() { return teamConfig; }
|
public TeamRepository getTeamRepository() {
|
||||||
|
requireTeamsEnabled();
|
||||||
|
return teamRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TeamService getTeamService() {
|
||||||
|
requireTeamsEnabled();
|
||||||
|
return teamService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TeamConfigService getTeamConfig() {
|
||||||
|
requireTeamsEnabled();
|
||||||
|
return teamConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TeamConfigService teamConfig() {
|
||||||
|
return getTeamConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerProfileRepository getPlayerProfileRepository() {
|
||||||
|
requirePlayersEnabled();
|
||||||
|
return playerProfileRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerProfileService getPlayerProfileService() {
|
||||||
|
requirePlayersEnabled();
|
||||||
|
return playerProfileService;
|
||||||
|
}
|
||||||
|
|
||||||
public CoreCommand getCoreCommand() { return coreCommand; }
|
public CoreCommand getCoreCommand() { return coreCommand; }
|
||||||
public boolean isEnabled() { return enabled; }
|
public boolean isEnabled() { return enabled; }
|
||||||
|
|
||||||
|
// ---- Guards ----
|
||||||
|
|
||||||
|
private void requireTeamsEnabled() {
|
||||||
|
if (!config.isTeamsEnabled()) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"Teams feature is not enabled — appelez CRCoreConfig.setupTeams() avant enable().");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void requirePlayersEnabled() {
|
||||||
|
if (!config.isPlayersEnabled()) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"Players feature is not enabled — appelez CRCoreConfig.setupPlayers() avant enable().");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,47 @@
|
|||||||
package fr.luc.crcore;
|
package fr.luc.crcore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration de {@link CRCore} fournie au constructeur. API builder : on
|
* Configuration de {@link CRCore} fournie au constructeur. API builder
|
||||||
* chaîne les {@code with...} pour modifier les valeurs par défaut.
|
* fluide.
|
||||||
|
*
|
||||||
|
* <h2>Modèle modulaire</h2>
|
||||||
|
*
|
||||||
|
* <p>Les <b>features</b> CR-Core (teams, players, placeholders PAPI) sont
|
||||||
|
* <b>opt-in</b> : par défaut <em>aucune</em> n'est activée, seule la couche
|
||||||
|
* util (messages, broadcasts, GUI framework, command framework, database)
|
||||||
|
* est chargée. Tu actives explicitement ce dont tu as besoin :
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
|
* // Tout activer en une ligne :
|
||||||
|
* new CRCore(this, new CRCoreConfig().setupAll()).enable();
|
||||||
|
*
|
||||||
|
* // Ou granularité :
|
||||||
|
* new CRCore(this, new CRCoreConfig()
|
||||||
|
* .setupTeams()
|
||||||
|
* .setupPlaceholders() // sans players
|
||||||
|
* .withCommandName("game"))
|
||||||
|
* .enable();
|
||||||
|
*
|
||||||
|
* // Tout par défaut + setups :
|
||||||
* new CRCore(this, new CRCoreConfig()
|
* new CRCore(this, new CRCoreConfig()
|
||||||
* .withSqliteFile("mydata.db")
|
* .withSqliteFile("mydata.db")
|
||||||
* .withCommandName("game"))
|
* .setupAll())
|
||||||
* .enable();
|
* .enable();
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* <p>Valeurs par défaut :
|
* <h2>Comportement quand une feature n'est pas activée</h2>
|
||||||
|
*
|
||||||
|
* <p>Le getter correspondant sur {@link CRCore} (ex. {@code core.getTeamService()})
|
||||||
|
* lève {@link IllegalStateException} avec un message explicite, et la
|
||||||
|
* commande built-in n'est pas enregistrée (ex. pas de {@code /core team}
|
||||||
|
* si {@code setupTeams()} n'a pas été appelé).
|
||||||
|
*
|
||||||
|
* <h2>Valeurs par défaut</h2>
|
||||||
|
*
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>SQLite activé, fichier {@code crcore.db} dans le dataFolder du plugin</li>
|
* <li>SQLite activé, fichier {@code crcore.db}</li>
|
||||||
* <li>Commande Bukkit racine : {@code core}</li>
|
* <li>Commande Bukkit racine : {@code core}</li>
|
||||||
|
* <li>Aucune feature activée (opt-in via {@code setupX()})</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class CRCoreConfig {
|
public class CRCoreConfig {
|
||||||
@@ -23,6 +50,13 @@ public class CRCoreConfig {
|
|||||||
private String sqliteFilename = "crcore.db";
|
private String sqliteFilename = "crcore.db";
|
||||||
private String commandName = "core";
|
private String commandName = "core";
|
||||||
|
|
||||||
|
// ---- Features (opt-in) ----
|
||||||
|
private boolean teamsEnabled = false;
|
||||||
|
private boolean playersEnabled = false;
|
||||||
|
private boolean placeholdersEnabled = false;
|
||||||
|
|
||||||
|
// ---- Util / infra setters ----
|
||||||
|
|
||||||
/** Désactive SQLite — toutes les données vivent en mémoire (perdues au reload/stop). */
|
/** Désactive SQLite — toutes les données vivent en mémoire (perdues au reload/stop). */
|
||||||
public CRCoreConfig withInMemoryStorage() {
|
public CRCoreConfig withInMemoryStorage() {
|
||||||
this.sqliteEnabled = false;
|
this.sqliteEnabled = false;
|
||||||
@@ -38,14 +72,61 @@ public class CRCoreConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Change le nom de la commande Bukkit racine. Doit matcher l'entrée du
|
* Change le nom de la commande Bukkit racine. Doit matcher l'entrée du
|
||||||
* {@code commands:} dans le {@code plugin.yml} du plugin de jeu.
|
* {@code commands:} dans le {@code plugin.yml} du plugin de jeu (ou
|
||||||
|
* passe par l'enregistrement dynamique de CR-Core si la commande n'est
|
||||||
|
* pas déclarée).
|
||||||
*/
|
*/
|
||||||
public CRCoreConfig withCommandName(String commandName) {
|
public CRCoreConfig withCommandName(String commandName) {
|
||||||
this.commandName = commandName;
|
this.commandName = commandName;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- Feature setups (opt-in) ----
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active la feature <b>team</b> : repositories, service, config + GUI,
|
||||||
|
* sous-commandes {@code /core team ...}. Tire les events Bukkit
|
||||||
|
* correspondants.
|
||||||
|
*/
|
||||||
|
public CRCoreConfig setupTeams() {
|
||||||
|
this.teamsEnabled = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active la feature <b>player</b> : repository et service de profil
|
||||||
|
* joueur (scores nommés, classements individuels). Tire les events
|
||||||
|
* Bukkit player.
|
||||||
|
*/
|
||||||
|
public CRCoreConfig setupPlayers() {
|
||||||
|
this.playersEnabled = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active l'intégration <b>PlaceholderAPI</b>. La hook ne sera réellement
|
||||||
|
* enregistrée que si PAPI est installé sur le serveur. Nécessite
|
||||||
|
* {@link #setupTeams()} et/ou {@link #setupPlayers()} pour les
|
||||||
|
* placeholders correspondants — sinon les placeholders manquants
|
||||||
|
* renvoient simplement vide.
|
||||||
|
*/
|
||||||
|
public CRCoreConfig setupPlaceholders() {
|
||||||
|
this.placeholdersEnabled = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Active toutes les features en une fois. */
|
||||||
|
public CRCoreConfig setupAll() {
|
||||||
|
return setupTeams().setupPlayers().setupPlaceholders();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- Getters ----
|
||||||
|
|
||||||
public boolean isSqliteEnabled() { return sqliteEnabled; }
|
public boolean isSqliteEnabled() { return sqliteEnabled; }
|
||||||
public String getSqliteFilename() { return sqliteFilename; }
|
public String getSqliteFilename() { return sqliteFilename; }
|
||||||
public String getCommandName() { return commandName; }
|
public String getCommandName() { return commandName; }
|
||||||
|
|
||||||
|
public boolean isTeamsEnabled() { return teamsEnabled; }
|
||||||
|
public boolean isPlayersEnabled() { return playersEnabled; }
|
||||||
|
public boolean isPlaceholdersEnabled() { return placeholdersEnabled; }
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-18
@@ -1,20 +1,27 @@
|
|||||||
package fr.luc.crcore.command.builtin;
|
package fr.luc.crcore.builtin;
|
||||||
|
|
||||||
import fr.luc.crcore.broadcast.BroadcastService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.command.BaseCommand;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.features.team.command.TeamGroupSubCommand;
|
||||||
import fr.luc.crcore.command.builtin.team.TeamGroupSubCommand;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.broadcast.BroadcastService;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.util.command.BaseCommand;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commande racine {@code /core}. Container des groupes par défaut + la
|
* Commande racine {@code /core}. Container des features actives.
|
||||||
* sous-commande {@link CoreReloadSubCommand} ({@code /core reload}).
|
*
|
||||||
|
* <p>Les services {@code teamService}, {@code playerProfileService} et
|
||||||
|
* {@code teamConfig} peuvent être {@code null} si la feature correspondante
|
||||||
|
* n'a pas été activée via {@link fr.luc.crcore.CRCoreConfig#setupTeams()}
|
||||||
|
* etc. — la sous-commande associée n'est alors simplement pas enregistrée.
|
||||||
|
*
|
||||||
|
* <p>{@code /core reload} et le rendu des messages communs (no-permission,
|
||||||
|
* etc.) restent toujours disponibles car ils ne dépendent que d'util.
|
||||||
*/
|
*/
|
||||||
public class CoreCommand extends BaseCommand {
|
public class CoreCommand extends BaseCommand {
|
||||||
|
|
||||||
@@ -30,25 +37,27 @@ public class CoreCommand extends BaseCommand {
|
|||||||
BroadcastService broadcasts,
|
BroadcastService broadcasts,
|
||||||
TeamConfigService teamConfig) {
|
TeamConfigService teamConfig) {
|
||||||
super("core");
|
super("core");
|
||||||
this.teamService = Objects.requireNonNull(teamService, "teamService");
|
// Les services de features peuvent être null (feature off).
|
||||||
this.playerProfileService = Objects.requireNonNull(playerProfileService, "playerProfileService");
|
this.teamService = teamService;
|
||||||
|
this.playerProfileService = playerProfileService;
|
||||||
this.messages = Objects.requireNonNull(messages, "messages");
|
this.messages = Objects.requireNonNull(messages, "messages");
|
||||||
this.broadcasts = Objects.requireNonNull(broadcasts, "broadcasts");
|
this.broadcasts = Objects.requireNonNull(broadcasts, "broadcasts");
|
||||||
this.teamConfig = Objects.requireNonNull(teamConfig, "teamConfig");
|
this.teamConfig = teamConfig;
|
||||||
description("Commandes du noyau CR-Core");
|
description("Commandes du noyau CR-Core");
|
||||||
registerDefaults();
|
registerDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Enregistre les groupes par défaut + la sous-commande reload. */
|
/** Enregistre les sous-commandes des features activées + reload. */
|
||||||
protected void registerDefaults() {
|
protected void registerDefaults() {
|
||||||
addSubCommand(new TeamGroupSubCommand(teamService, messages, teamConfig));
|
if (teamService != null && teamConfig != null) {
|
||||||
|
addSubCommand(new TeamGroupSubCommand(teamService, messages, teamConfig));
|
||||||
|
}
|
||||||
addSubCommand(new CoreReloadSubCommand(messages, broadcasts, teamConfig));
|
addSubCommand(new CoreReloadSubCommand(messages, broadcasts, teamConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override de {@link BaseCommand#handleResult} pour utiliser
|
* Override de {@link BaseCommand#handleResult} pour utiliser
|
||||||
* {@link MessagesService} sur les cas génériques (no-permission,
|
* {@link MessagesService} sur les cas génériques.
|
||||||
* player-only, etc.) au lieu des strings hardcodés du framework.
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void handleResult(CommandSender sender, CommandResult result) {
|
protected void handleResult(CommandSender sender, CommandResult result) {
|
||||||
+10
-9
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin;
|
package fr.luc.crcore.builtin;
|
||||||
|
|
||||||
import fr.luc.crcore.broadcast.BroadcastService;
|
import fr.luc.crcore.util.broadcast.BroadcastService;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -28,7 +28,8 @@ public class CoreReloadSubCommand extends SubCommand {
|
|||||||
super("reload");
|
super("reload");
|
||||||
this.messages = Objects.requireNonNull(messages, "messages");
|
this.messages = Objects.requireNonNull(messages, "messages");
|
||||||
this.broadcasts = Objects.requireNonNull(broadcasts, "broadcasts");
|
this.broadcasts = Objects.requireNonNull(broadcasts, "broadcasts");
|
||||||
this.teamConfig = Objects.requireNonNull(teamConfig, "teamConfig");
|
// teamConfig peut être null si la feature teams n'est pas activée.
|
||||||
|
this.teamConfig = teamConfig;
|
||||||
description("Recharger les fichiers messages, broadcasts et team-config");
|
description("Recharger les fichiers messages, broadcasts et team-config");
|
||||||
permission("crcore.reload");
|
permission("crcore.reload");
|
||||||
}
|
}
|
||||||
@@ -37,7 +38,7 @@ public class CoreReloadSubCommand extends SubCommand {
|
|||||||
public CommandResult execute(CommandContext ctx) {
|
public CommandResult execute(CommandContext ctx) {
|
||||||
messages.reload();
|
messages.reload();
|
||||||
broadcasts.reload();
|
broadcasts.reload();
|
||||||
teamConfig.reload();
|
if (teamConfig != null) teamConfig.reload();
|
||||||
return CommandResult.success(messages.get("common.reload.success"));
|
return CommandResult.success(messages.get("common.reload.success"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package fr.luc.crcore.player;
|
package fr.luc.crcore.features.player;
|
||||||
|
|
||||||
import fr.luc.crcore.common.AbstractEntity;
|
import fr.luc.crcore.util.common.AbstractEntity;
|
||||||
import fr.luc.crcore.common.ScoreHolder;
|
import fr.luc.crcore.util.common.ScoreHolder;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package fr.luc.crcore.features.player;
|
||||||
|
|
||||||
|
import fr.luc.crcore.util.common.Repository;
|
||||||
|
|
||||||
|
public interface PlayerProfileRepository extends Repository<PlayerProfile> {
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.player;
|
package fr.luc.crcore.features.player;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.player;
|
package fr.luc.crcore.features.player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.player.event;
|
package fr.luc.crcore.features.player.event;
|
||||||
|
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/** Déclenché juste après la création d'un profil (lazy ou explicite). */
|
/** Déclenché juste après la création d'un profil (lazy ou explicite). */
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.player.event;
|
package fr.luc.crcore.features.player.event;
|
||||||
|
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/** Déclenché juste après la suppression d'un profil. */
|
/** Déclenché juste après la suppression d'un profil. */
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.player.event;
|
package fr.luc.crcore.features.player.event;
|
||||||
|
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.player.event;
|
package fr.luc.crcore.features.player.event;
|
||||||
|
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.player.exception;
|
package fr.luc.crcore.features.player.exception;
|
||||||
|
|
||||||
public class PlayerException extends RuntimeException {
|
public class PlayerException extends RuntimeException {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.player.exception;
|
package fr.luc.crcore.features.player.exception;
|
||||||
|
|
||||||
public class PlayerProfileNotFoundException extends PlayerException {
|
public class PlayerProfileNotFoundException extends PlayerException {
|
||||||
|
|
||||||
+10
-10
@@ -1,14 +1,14 @@
|
|||||||
package fr.luc.crcore.player.impl;
|
package fr.luc.crcore.features.player.impl;
|
||||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
import fr.luc.crcore.features.player.exception.PlayerProfileNotFoundException;
|
||||||
import fr.luc.crcore.player.exception.PlayerException;
|
import fr.luc.crcore.features.player.exception.PlayerException;
|
||||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
import fr.luc.crcore.features.player.PlayerProfileRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.player.PlayerRanking;
|
import fr.luc.crcore.features.player.PlayerRanking;
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
|
|
||||||
import fr.luc.crcore.player.event.PlayerProfileCreateEvent;
|
import fr.luc.crcore.features.player.event.PlayerProfileCreateEvent;
|
||||||
import fr.luc.crcore.player.event.PlayerProfileDeleteEvent;
|
import fr.luc.crcore.features.player.event.PlayerProfileDeleteEvent;
|
||||||
import fr.luc.crcore.player.event.PlayerScoreChangeEvent;
|
import fr.luc.crcore.features.player.event.PlayerScoreChangeEvent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
+7
-7
@@ -1,10 +1,10 @@
|
|||||||
package fr.luc.crcore.player.impl;
|
package fr.luc.crcore.features.player.impl;
|
||||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
import fr.luc.crcore.features.player.exception.PlayerProfileNotFoundException;
|
||||||
import fr.luc.crcore.player.exception.PlayerException;
|
import fr.luc.crcore.features.player.exception.PlayerException;
|
||||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
import fr.luc.crcore.features.player.PlayerProfileRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.player.PlayerRanking;
|
import fr.luc.crcore.features.player.PlayerRanking;
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
+7
-7
@@ -1,10 +1,10 @@
|
|||||||
package fr.luc.crcore.player.impl;
|
package fr.luc.crcore.features.player.impl;
|
||||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
import fr.luc.crcore.features.player.exception.PlayerProfileNotFoundException;
|
||||||
import fr.luc.crcore.player.exception.PlayerException;
|
import fr.luc.crcore.features.player.exception.PlayerException;
|
||||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
import fr.luc.crcore.features.player.PlayerProfileRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.player.PlayerRanking;
|
import fr.luc.crcore.features.player.PlayerRanking;
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
+10
-10
@@ -1,13 +1,13 @@
|
|||||||
package fr.luc.crcore.player.impl;
|
package fr.luc.crcore.features.player.impl;
|
||||||
import fr.luc.crcore.player.exception.PlayerProfileNotFoundException;
|
import fr.luc.crcore.features.player.exception.PlayerProfileNotFoundException;
|
||||||
import fr.luc.crcore.player.exception.PlayerException;
|
import fr.luc.crcore.features.player.exception.PlayerException;
|
||||||
import fr.luc.crcore.player.PlayerProfileRepository;
|
import fr.luc.crcore.features.player.PlayerProfileRepository;
|
||||||
import fr.luc.crcore.player.PlayerProfileService;
|
import fr.luc.crcore.features.player.PlayerProfileService;
|
||||||
import fr.luc.crcore.player.PlayerRanking;
|
import fr.luc.crcore.features.player.PlayerRanking;
|
||||||
import fr.luc.crcore.player.PlayerProfile;
|
import fr.luc.crcore.features.player.PlayerProfile;
|
||||||
|
|
||||||
import fr.luc.crcore.database.ColumnType;
|
import fr.luc.crcore.util.database.ColumnType;
|
||||||
import fr.luc.crcore.database.Database;
|
import fr.luc.crcore.util.database.Database;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -15,7 +15,7 @@ import java.util.UUID;
|
|||||||
/**
|
/**
|
||||||
* Implémentation {@link PlayerProfileRepository} adossée à SQLite.
|
* Implémentation {@link PlayerProfileRepository} adossée à SQLite.
|
||||||
*
|
*
|
||||||
* <p>Mêmes principes que {@link fr.luc.crcore.team.SqliteTeamRepository} :
|
* <p>Mêmes principes que {@link fr.luc.crcore.features.team.SqliteTeamRepository} :
|
||||||
* cache mémoire en write-through, schéma créé à l'init, état rechargé depuis
|
* cache mémoire en write-through, schéma créé à l'init, état rechargé depuis
|
||||||
* la DB au constructeur.
|
* la DB au constructeur.
|
||||||
*
|
*
|
||||||
+6
-6
@@ -1,8 +1,8 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import fr.luc.crcore.common.AbstractEntity;
|
import fr.luc.crcore.util.common.AbstractEntity;
|
||||||
import fr.luc.crcore.common.Named;
|
import fr.luc.crcore.util.common.Named;
|
||||||
import fr.luc.crcore.common.ScoreHolder;
|
import fr.luc.crcore.util.common.ScoreHolder;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -79,11 +79,11 @@ public class Team extends AbstractEntity implements Named, ScoreHolder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Map mutable des overrides per-team de settings. Clé = nom du
|
* Map mutable des overrides per-team de settings. Clé = nom du
|
||||||
* {@link fr.luc.crcore.team.config.TeamSetting}, valeur = forme
|
* {@link fr.luc.crcore.features.team.config.TeamSetting}, valeur = forme
|
||||||
* sérialisable (Boolean, Integer, String, …).
|
* sérialisable (Boolean, Integer, String, …).
|
||||||
*
|
*
|
||||||
* <p>Lecture / modification typée recommandée via
|
* <p>Lecture / modification typée recommandée via
|
||||||
* {@link fr.luc.crcore.team.config.TeamConfigService}, qui gère la
|
* {@link fr.luc.crcore.features.team.config.TeamConfigService}, qui gère la
|
||||||
* cascade per-team → global → default et persiste les écritures.
|
* cascade per-team → global → default et persiste les écritures.
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> getSettings() {
|
public Map<String, Object> getSettings() {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import fr.luc.crcore.common.AbstractEntity;
|
import fr.luc.crcore.util.common.AbstractEntity;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import fr.luc.crcore.common.Repository;
|
import fr.luc.crcore.util.common.Repository;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
public enum TeamRole {
|
public enum TeamRole {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team;
|
package fr.luc.crcore.features.team;
|
||||||
|
|
||||||
public enum TeamVisibility {
|
public enum TeamVisibility {
|
||||||
|
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentType;
|
import fr.luc.crcore.util.command.ArgumentType;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -30,7 +30,7 @@ public final class TeamArgumentTypes {
|
|||||||
@Override
|
@Override
|
||||||
public Team parse(String input) {
|
public Team parse(String input) {
|
||||||
return service.getTeamByName(input).orElseThrow(() ->
|
return service.getTeamByName(input).orElseThrow(() ->
|
||||||
new fr.luc.crcore.command.CommandException(
|
new fr.luc.crcore.util.command.CommandException(
|
||||||
"Aucune équipe trouvée : " + input));
|
"Aucune équipe trouvée : " + input));
|
||||||
}
|
}
|
||||||
|
|
||||||
+11
-11
@@ -1,15 +1,15 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamColor;
|
import fr.luc.crcore.features.team.TeamColor;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
|
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+10
-10
@@ -1,13 +1,13 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.team.config.gui.GlobalSettingsGui;
|
import fr.luc.crcore.features.team.config.gui.GlobalSettingsGui;
|
||||||
import fr.luc.crcore.team.config.gui.TeamSettingsGui;
|
import fr.luc.crcore.features.team.config.gui.TeamSettingsGui;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -31,7 +31,7 @@ public class TeamSettingsSubCommand extends SubCommand {
|
|||||||
|
|
||||||
public TeamSettingsSubCommand(TeamConfigService config,
|
public TeamSettingsSubCommand(TeamConfigService config,
|
||||||
MessagesService messages,
|
MessagesService messages,
|
||||||
fr.luc.crcore.team.TeamService teamService) {
|
fr.luc.crcore.features.team.TeamService teamService) {
|
||||||
super("settings");
|
super("settings");
|
||||||
this.config = Objects.requireNonNull(config, "config");
|
this.config = Objects.requireNonNull(config, "config");
|
||||||
this.messages = Objects.requireNonNull(messages, "messages");
|
this.messages = Objects.requireNonNull(messages, "messages");
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.TeamRanking;
|
import fr.luc.crcore.features.team.TeamRanking;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
|
|
||||||
+9
-9
@@ -1,13 +1,13 @@
|
|||||||
package fr.luc.crcore.command.builtin.team;
|
package fr.luc.crcore.features.team.command;
|
||||||
|
|
||||||
import fr.luc.crcore.command.ArgumentTypes;
|
import fr.luc.crcore.util.command.ArgumentTypes;
|
||||||
import fr.luc.crcore.command.CommandContext;
|
import fr.luc.crcore.util.command.CommandContext;
|
||||||
import fr.luc.crcore.command.CommandResult;
|
import fr.luc.crcore.util.command.CommandResult;
|
||||||
import fr.luc.crcore.command.SubCommand;
|
import fr.luc.crcore.util.command.SubCommand;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.config;
|
package fr.luc.crcore.features.team.config;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.config;
|
package fr.luc.crcore.features.team.config;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.config;
|
package fr.luc.crcore.features.team.config;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
package fr.luc.crcore.team.config.gui;
|
package fr.luc.crcore.features.team.config.gui;
|
||||||
|
|
||||||
import fr.luc.crcore.gui.AbstractInventoryGui;
|
import fr.luc.crcore.util.gui.AbstractInventoryGui;
|
||||||
import fr.luc.crcore.gui.GuiItems;
|
import fr.luc.crcore.util.gui.GuiItems;
|
||||||
import fr.luc.crcore.team.config.TeamSetting;
|
import fr.luc.crcore.features.team.config.TeamSetting;
|
||||||
import fr.luc.crcore.team.config.TeamSettings;
|
import fr.luc.crcore.features.team.config.TeamSettings;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
@@ -120,7 +120,7 @@ public abstract class AbstractSettingsGui extends AbstractInventoryGui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T> fr.luc.crcore.gui.GuiClickHandler createIntHandler(TeamSetting<T> setting, Integer baseValue) {
|
private <T> fr.luc.crcore.util.gui.GuiClickHandler createIntHandler(TeamSetting<T> setting, Integer baseValue) {
|
||||||
return event -> {
|
return event -> {
|
||||||
Integer current = (Integer) getCurrentValue((TeamSetting<?>) setting);
|
Integer current = (Integer) getCurrentValue((TeamSetting<?>) setting);
|
||||||
int amount = computeIntDelta(event);
|
int amount = computeIntDelta(event);
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package fr.luc.crcore.team.config.gui;
|
package fr.luc.crcore.features.team.config.gui;
|
||||||
|
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.team.config.TeamSetting;
|
import fr.luc.crcore.features.team.config.TeamSetting;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package fr.luc.crcore.team.config.gui;
|
package fr.luc.crcore.features.team.config.gui;
|
||||||
|
|
||||||
import fr.luc.crcore.gui.GuiItems;
|
import fr.luc.crcore.util.gui.GuiItems;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.team.config.TeamSetting;
|
import fr.luc.crcore.features.team.config.TeamSetting;
|
||||||
import fr.luc.crcore.team.config.TeamSettings;
|
import fr.luc.crcore.features.team.config.TeamSettings;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package fr.luc.crcore.team.config.impl;
|
package fr.luc.crcore.features.team.config.impl;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.team.config.TeamConfigService;
|
import fr.luc.crcore.features.team.config.TeamConfigService;
|
||||||
import fr.luc.crcore.team.config.TeamSetting;
|
import fr.luc.crcore.features.team.config.TeamSetting;
|
||||||
import fr.luc.crcore.team.config.TeamSettings;
|
import fr.luc.crcore.features.team.config.TeamSettings;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/** Déclenché juste après la dissolution d'une équipe. */
|
/** Déclenché juste après la dissolution d'une équipe. */
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package fr.luc.crcore.team.event;
|
package fr.luc.crcore.features.team.event;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.exception;
|
package fr.luc.crcore.features.team.exception;
|
||||||
|
|
||||||
public class TeamAccessException extends TeamException {
|
public class TeamAccessException extends TeamException {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.exception;
|
package fr.luc.crcore.features.team.exception;
|
||||||
|
|
||||||
public class TeamAlreadyExistsException extends TeamException {
|
public class TeamAlreadyExistsException extends TeamException {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.exception;
|
package fr.luc.crcore.features.team.exception;
|
||||||
|
|
||||||
public class TeamException extends RuntimeException {
|
public class TeamException extends RuntimeException {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.team.exception;
|
package fr.luc.crcore.features.team.exception;
|
||||||
|
|
||||||
public class TeamNotFoundException extends TeamException {
|
public class TeamNotFoundException extends TeamException {
|
||||||
|
|
||||||
+22
-22
@@ -1,26 +1,26 @@
|
|||||||
package fr.luc.crcore.team.impl;
|
package fr.luc.crcore.features.team.impl;
|
||||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
import fr.luc.crcore.features.team.exception.TeamAccessException;
|
||||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
import fr.luc.crcore.features.team.exception.TeamNotFoundException;
|
||||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
import fr.luc.crcore.features.team.exception.TeamAlreadyExistsException;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamRanking;
|
import fr.luc.crcore.features.team.TeamRanking;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import fr.luc.crcore.team.TeamColor;
|
import fr.luc.crcore.features.team.TeamColor;
|
||||||
import fr.luc.crcore.team.TeamRole;
|
import fr.luc.crcore.features.team.TeamRole;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import fr.luc.crcore.team.event.PlayerJoinTeamEvent;
|
import fr.luc.crcore.features.team.event.PlayerJoinTeamEvent;
|
||||||
import fr.luc.crcore.team.event.TeamCreateEvent;
|
import fr.luc.crcore.features.team.event.TeamCreateEvent;
|
||||||
import fr.luc.crcore.team.event.TeamDissolveEvent;
|
import fr.luc.crcore.features.team.event.TeamDissolveEvent;
|
||||||
import fr.luc.crcore.team.event.TeamLeadershipTransferEvent;
|
import fr.luc.crcore.features.team.event.TeamLeadershipTransferEvent;
|
||||||
import fr.luc.crcore.team.event.TeamMemberAddEvent;
|
import fr.luc.crcore.features.team.event.TeamMemberAddEvent;
|
||||||
import fr.luc.crcore.team.event.TeamMemberRemoveEvent;
|
import fr.luc.crcore.features.team.event.TeamMemberRemoveEvent;
|
||||||
import fr.luc.crcore.team.event.TeamScoreChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamScoreChangeEvent;
|
||||||
import fr.luc.crcore.team.event.TeamSpawnPointChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamSpawnPointChangeEvent;
|
||||||
import fr.luc.crcore.team.event.TeamVisibilityChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamVisibilityChangeEvent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
+13
-13
@@ -1,16 +1,16 @@
|
|||||||
package fr.luc.crcore.team.impl;
|
package fr.luc.crcore.features.team.impl;
|
||||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
import fr.luc.crcore.features.team.exception.TeamAccessException;
|
||||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
import fr.luc.crcore.features.team.exception.TeamNotFoundException;
|
||||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
import fr.luc.crcore.features.team.exception.TeamAlreadyExistsException;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamRanking;
|
import fr.luc.crcore.features.team.TeamRanking;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import fr.luc.crcore.team.TeamColor;
|
import fr.luc.crcore.features.team.TeamColor;
|
||||||
import fr.luc.crcore.team.TeamRole;
|
import fr.luc.crcore.features.team.TeamRole;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
+15
-15
@@ -1,19 +1,19 @@
|
|||||||
package fr.luc.crcore.team.impl;
|
package fr.luc.crcore.features.team.impl;
|
||||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
import fr.luc.crcore.features.team.exception.TeamAccessException;
|
||||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
import fr.luc.crcore.features.team.exception.TeamNotFoundException;
|
||||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
import fr.luc.crcore.features.team.exception.TeamAlreadyExistsException;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamRanking;
|
import fr.luc.crcore.features.team.TeamRanking;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import fr.luc.crcore.team.TeamColor;
|
import fr.luc.crcore.features.team.TeamColor;
|
||||||
import fr.luc.crcore.team.TeamRole;
|
import fr.luc.crcore.features.team.TeamRole;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import fr.luc.crcore.database.ColumnType;
|
import fr.luc.crcore.util.database.ColumnType;
|
||||||
import fr.luc.crcore.database.Database;
|
import fr.luc.crcore.util.database.Database;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
+13
-13
@@ -1,16 +1,16 @@
|
|||||||
package fr.luc.crcore.team.impl;
|
package fr.luc.crcore.features.team.impl;
|
||||||
import fr.luc.crcore.team.exception.TeamAccessException;
|
import fr.luc.crcore.features.team.exception.TeamAccessException;
|
||||||
import fr.luc.crcore.team.exception.TeamNotFoundException;
|
import fr.luc.crcore.features.team.exception.TeamNotFoundException;
|
||||||
import fr.luc.crcore.team.exception.TeamAlreadyExistsException;
|
import fr.luc.crcore.features.team.exception.TeamAlreadyExistsException;
|
||||||
import fr.luc.crcore.team.exception.TeamException;
|
import fr.luc.crcore.features.team.exception.TeamException;
|
||||||
import fr.luc.crcore.team.TeamRepository;
|
import fr.luc.crcore.features.team.TeamRepository;
|
||||||
import fr.luc.crcore.team.TeamService;
|
import fr.luc.crcore.features.team.TeamService;
|
||||||
import fr.luc.crcore.team.TeamRanking;
|
import fr.luc.crcore.features.team.TeamRanking;
|
||||||
import fr.luc.crcore.team.TeamVisibility;
|
import fr.luc.crcore.features.team.TeamVisibility;
|
||||||
import fr.luc.crcore.team.TeamColor;
|
import fr.luc.crcore.features.team.TeamColor;
|
||||||
import fr.luc.crcore.team.TeamRole;
|
import fr.luc.crcore.features.team.TeamRole;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package fr.luc.crcore.player;
|
|
||||||
|
|
||||||
import fr.luc.crcore.common.Repository;
|
|
||||||
|
|
||||||
public interface PlayerProfileRepository extends Repository<PlayerProfile> {
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.broadcast;
|
package fr.luc.crcore.util.broadcast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public destinataire d'un broadcast CR-Core.
|
* Public destinataire d'un broadcast CR-Core.
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package fr.luc.crcore.broadcast;
|
package fr.luc.crcore.util.broadcast;
|
||||||
|
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.broadcast;
|
package fr.luc.crcore.util.broadcast;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
+14
-14
@@ -1,18 +1,18 @@
|
|||||||
package fr.luc.crcore.broadcast;
|
package fr.luc.crcore.util.broadcast;
|
||||||
|
|
||||||
import fr.luc.crcore.player.event.PlayerProfileCreateEvent;
|
import fr.luc.crcore.features.player.event.PlayerProfileCreateEvent;
|
||||||
import fr.luc.crcore.player.event.PlayerProfileDeleteEvent;
|
import fr.luc.crcore.features.player.event.PlayerProfileDeleteEvent;
|
||||||
import fr.luc.crcore.player.event.PlayerScoreChangeEvent;
|
import fr.luc.crcore.features.player.event.PlayerScoreChangeEvent;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.event.PlayerJoinTeamEvent;
|
import fr.luc.crcore.features.team.event.PlayerJoinTeamEvent;
|
||||||
import fr.luc.crcore.team.event.TeamCreateEvent;
|
import fr.luc.crcore.features.team.event.TeamCreateEvent;
|
||||||
import fr.luc.crcore.team.event.TeamDissolveEvent;
|
import fr.luc.crcore.features.team.event.TeamDissolveEvent;
|
||||||
import fr.luc.crcore.team.event.TeamLeadershipTransferEvent;
|
import fr.luc.crcore.features.team.event.TeamLeadershipTransferEvent;
|
||||||
import fr.luc.crcore.team.event.TeamMemberAddEvent;
|
import fr.luc.crcore.features.team.event.TeamMemberAddEvent;
|
||||||
import fr.luc.crcore.team.event.TeamMemberRemoveEvent;
|
import fr.luc.crcore.features.team.event.TeamMemberRemoveEvent;
|
||||||
import fr.luc.crcore.team.event.TeamScoreChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamScoreChangeEvent;
|
||||||
import fr.luc.crcore.team.event.TeamSpawnPointChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamSpawnPointChangeEvent;
|
||||||
import fr.luc.crcore.team.event.TeamVisibilityChangeEvent;
|
import fr.luc.crcore.features.team.event.TeamVisibilityChangeEvent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package fr.luc.crcore.broadcast.impl;
|
package fr.luc.crcore.util.broadcast.impl;
|
||||||
|
|
||||||
import fr.luc.crcore.broadcast.BroadcastAudience;
|
import fr.luc.crcore.util.broadcast.BroadcastAudience;
|
||||||
import fr.luc.crcore.broadcast.BroadcastContext;
|
import fr.luc.crcore.util.broadcast.BroadcastContext;
|
||||||
import fr.luc.crcore.broadcast.BroadcastService;
|
import fr.luc.crcore.util.broadcast.BroadcastService;
|
||||||
import fr.luc.crcore.message.MessagesService;
|
import fr.luc.crcore.util.message.MessagesService;
|
||||||
import fr.luc.crcore.team.Team;
|
import fr.luc.crcore.features.team.Team;
|
||||||
import fr.luc.crcore.team.TeamMember;
|
import fr.luc.crcore.features.team.TeamMember;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
public class CommandException extends RuntimeException {
|
public class CommandException extends RuntimeException {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
public final class CommandResult {
|
public final class CommandResult {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.command;
|
package fr.luc.crcore.util.command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sous-commande imbriquée. Peut être :
|
* Sous-commande imbriquée. Peut être :
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.common;
|
package fr.luc.crcore.util.common;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.common;
|
package fr.luc.crcore.util.common;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.common;
|
package fr.luc.crcore.util.common;
|
||||||
|
|
||||||
public interface Named {
|
public interface Named {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.luc.crcore.common;
|
package fr.luc.crcore.util.common;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user