From 73815323e05678b848b3795c6fa40274dc889607 Mon Sep 17 00:00:00 2001 From: Vankka Date: Sat, 9 Oct 2021 20:49:59 +0300 Subject: [PATCH] Updated sponge build --- sponge/loader/build.gradle | 15 ++++++++++----- .../sponge/DiscordSRVSpongeBootstrap.java | 6 +++--- .../sponge/scheduler/SpongeScheduler.java | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/sponge/loader/build.gradle b/sponge/loader/build.gradle index 0a0f7ec8..38b34c54 100644 --- a/sponge/loader/build.gradle +++ b/sponge/loader/build.gradle @@ -1,8 +1,8 @@ import org.spongepowered.gradle.plugin.config.PluginLoaders -import org.spongepowered.plugin.metadata.PluginDependency +import org.spongepowered.plugin.metadata.model.PluginDependency plugins { - id 'org.spongepowered.gradle.plugin' version '1.1.1' + id 'org.spongepowered.gradle.plugin' version '2.0.0' } apply from: rootProject.file('buildscript/loader.gradle') @@ -22,12 +22,16 @@ shadowJar { // buildscript/loader.gradle includes the jarinjar in the jar sponge { - apiVersion('8.0.0') + apiVersion('8.0.0-SNAPSHOT') + license('GPLv3') + loader { + name(PluginLoaders.JAVA_PLAIN) + version('1.0') + } plugin('discordsrv') { - loader(PluginLoaders.JAVA_PLAIN) displayName('DiscordSRV') version(project.version) - mainClass('com.discordsrv.sponge.loader.DiscordSRVSpongeLoader') + entrypoint('com.discordsrv.sponge.loader.DiscordSRVSpongeLoader') description('') links { homepage('https://discordsrv.com') @@ -42,6 +46,7 @@ sponge { } dependency('spongeapi') { loadOrder(PluginDependency.LoadOrder.AFTER) + version('[8.0.0,)') optional(false) } } diff --git a/sponge/src/main/java/com/discordsrv/sponge/DiscordSRVSpongeBootstrap.java b/sponge/src/main/java/com/discordsrv/sponge/DiscordSRVSpongeBootstrap.java index 1c045aec..68d05cd6 100644 --- a/sponge/src/main/java/com/discordsrv/sponge/DiscordSRVSpongeBootstrap.java +++ b/sponge/src/main/java/com/discordsrv/sponge/DiscordSRVSpongeBootstrap.java @@ -63,13 +63,13 @@ public class DiscordSRVSpongeBootstrap extends AbstractBootstrap implements ISpo public void onConstruct() { // Wait until dependencies ready, then initialize DiscordSRV dependencies.join(); - this.discordSRV = new SpongeDiscordSRV(logger, pluginContainer, game, classLoader, dataDirectory); - - dependencies.runWhenComplete(discordSRV::invokeEnable); } @Override public void onStarted() { + this.discordSRV = new SpongeDiscordSRV(logger, pluginContainer, game, classLoader, dataDirectory); + + dependencies.runWhenComplete(discordSRV::invokeEnable); dependencies.runWhenComplete(discordSRV::invokeServerStarted); } diff --git a/sponge/src/main/java/com/discordsrv/sponge/scheduler/SpongeScheduler.java b/sponge/src/main/java/com/discordsrv/sponge/scheduler/SpongeScheduler.java index 706ccd33..a79241ee 100644 --- a/sponge/src/main/java/com/discordsrv/sponge/scheduler/SpongeScheduler.java +++ b/sponge/src/main/java/com/discordsrv/sponge/scheduler/SpongeScheduler.java @@ -31,7 +31,7 @@ public class SpongeScheduler extends StandardScheduler implements ServerSchedule public SpongeScheduler(SpongeDiscordSRV discordSRV) { super(discordSRV); - this.service = discordSRV.game().server().scheduler().createExecutor(discordSRV.container()); + this.service = discordSRV.game().server().scheduler().executor(discordSRV.container()); } @Override