Updated sponge build

This commit is contained in:
Vankka 2021-10-09 20:49:59 +03:00
parent 1dcb513e9a
commit 73815323e0
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
3 changed files with 14 additions and 9 deletions

View File

@ -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)
}
}

View File

@ -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);
}

View File

@ -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