Skip to content

Commit

Permalink
GH-18 Release 1.2.1 hotfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
SfenKer committed Mar 14, 2024
1 parent f866717 commit a50e427
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>pl.mrstudios.deathrun</groupId>
<artifactId>deathrun-parent</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</parent>

<artifactId>deathrun-api</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>pl.mrstudios.deathrun</groupId>
<artifactId>deathrun-parent</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</parent>

<artifactId>deathrun-core</artifactId>
Expand Down Expand Up @@ -227,11 +227,11 @@
</dependencies>

<properties>
<kyori.adventure.version>4.15.0</kyori.adventure.version>
<kyori.adventure.version>4.16.0</kyori.adventure.version>
<mrstudios.commons.version>1.0.0</mrstudios.commons.version>
<okaeri.configs.version>5.0.0-beta.5</okaeri.configs.version>
<adventure.platform.version>4.3.2</adventure.platform.version>
<rollczi.litecommands.version>3.3.2</rollczi.litecommands.version>
<rollczi.litecommands.version>3.4.0</rollczi.litecommands.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
19 changes: 14 additions & 5 deletions core/src/main/java/pl/mrstudios/deathrun/plugin/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import pl.mrstudios.commons.inject.Injector;
import pl.mrstudios.commons.inject.annotation.Inject;
import pl.mrstudios.commons.reflection.Reflections;
import pl.mrstudios.deathrun.api.API;
import pl.mrstudios.deathrun.arena.Arena;
Expand All @@ -42,6 +43,9 @@
import java.util.Objects;
import java.util.stream.Stream;

import static java.lang.System.currentTimeMillis;
import static java.util.Arrays.stream;

@SuppressWarnings("all")
public class Bootstrap extends JavaPlugin {

Expand Down Expand Up @@ -149,8 +153,13 @@ public void onEnable() {
/* Register Listeners */
if (!this.configuration.map().arenaSetupEnabled)
new Reflections<Listener>("pl.mrstudios.deathrun")
.getClassesImplementing(Listener.class)
.forEach((listener) -> this.getServer().getPluginManager().registerEvents(this.injector.inject(listener), this));
.getClassesImplementing(Listener.class).stream().filter(
(listener) -> stream(listener.getConstructors())
.anyMatch((constructor) -> constructor.isAnnotationPresent(Inject.class))
).forEach(
(listener) -> this.getServer().getPluginManager()
.registerEvents(this.injector.inject(listener), this)
);

/* Start Arena Service */
if (!this.configuration.map().arenaSetupEnabled)
Expand Down Expand Up @@ -187,7 +196,7 @@ public void onLoad() {
.filter((file) -> file.getName().endsWith(".zip"))
.forEach((file) -> {

long startTime = System.currentTimeMillis();
long startTime = currentTimeMillis();
this.getLogger().info("Restoring " + file.getName().replace(".zip", "") + " world backup.");

try {
Expand All @@ -196,10 +205,10 @@ public void onLoad() {
FileUtils.deleteDirectory(worldFile);

ZipUtil.unzip(file, worldFile.toPath());
this.getLogger().info("Restoring " + file.getName().replace(".zip", "") + " world backup complete. [" + (System.currentTimeMillis() - startTime) + "ms]");
this.getLogger().info("Restoring " + file.getName().replace(".zip", "") + " world backup complete. [" + (currentTimeMillis() - startTime) + "ms]");

} catch (Exception exception) {
this.getLogger().severe("Restoring " + file.getName().replace(".zip", "") + " world backup failed. [" + (System.currentTimeMillis() - startTime) + "ms]");
this.getLogger().severe("Restoring " + file.getName().replace(".zip", "") + " world backup failed. [" + (currentTimeMillis() - startTime) + "ms]");
}

});
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<groupId>pl.mrstudios.deathrun</groupId>
<artifactId>deathrun-parent</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<packaging>pom</packaging>

<modules>
Expand Down

0 comments on commit a50e427

Please sign in to comment.