Skip to content

Commit

Permalink
Added log messages on tournament load
Browse files Browse the repository at this point in the history
  • Loading branch information
WaterArchery committed Sep 15, 2024
1 parent e7fa206 commit 7baece2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.waterarchery</groupId>
<artifactId>LitTournaments</artifactId>
<version>1.2.1</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>LitTournaments</name>
Expand Down Expand Up @@ -86,6 +86,10 @@
</build>

<repositories>
<repository>
<id>BenCodez Repo</id>
<url>https://nexus.bencodez.com/repository/maven-public/</url>
</repository>
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
Expand Down Expand Up @@ -211,5 +215,11 @@
<version>9.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>votifierplus</artifactId>
<version>1.0.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ private void loadTournament(String identifier, FileConfiguration yml) {
}

private void loadClass(Class<Tournament> tournamentClass, Object... args) {
LitLibs libs = LitTournaments.getLitLibs();
Logger logger = libs.getLogger();
try {
Class<?>[] argTypes = Arrays.stream(args)
.map(Object::getClass)
.toArray(Class<?>[]::new);

Tournament tournament = tournamentClass.getDeclaredConstructor(argTypes).newInstance(args);
logger.log(String.format("Tournament loaded: %s", tournament.getIdentifier()));
addTournament(tournament);
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex) {
throw new RuntimeException(ex);
Expand Down

0 comments on commit 7baece2

Please sign in to comment.