diff --git a/build.gradle b/build.gradle index a1e22912..8e67b865 100644 --- a/build.gradle +++ b/build.gradle @@ -6,11 +6,9 @@ buildscript { name = 'sponge' url = 'https://repo.spongepowered.org/maven' } - repositories { - maven { - url "https://plugins.gradle.org/m2/" + maven { + url "https://plugins.gradle.org/m2/" - } } } dependencies { @@ -33,7 +31,7 @@ apply plugin: 'org.spongepowered.mixin' //Build variables -version = "3.0.0" +version = "3.0.2" group = "de.erdbeerbaerlp.dcintegration" archivesBaseName = "dcintegration-forge" @@ -71,7 +69,7 @@ configurations { embed minecraftLibrary.extendsFrom(embed) } -task release{ +task release { } @@ -97,7 +95,7 @@ configurations.all { //Dependencies dependencies { // ========= Common ===================== - embed('de.erdbeerbaerlp:dcintegration.common:3.0.0') { + embed('de.erdbeerbaerlp:dcintegration.common:3.0.2') { changing = true } @@ -154,11 +152,11 @@ curseforge { } } } -modrinth{ +modrinth { if (project.hasProperty('modrinth.apikey')) { // $GRADLE_USER_HOME/gradle.properties token = getProperty("modrinth.apikey") // Use an environment property! projectId = 'rbJ7eS5V' - versionNumber = version+"-${project.mcVersion}" + versionNumber = version + "-${project.mcVersion}" versionName = "DiscordIntegration-Forge $version (MC ${project.mcVersion})" uploadFile = shadowJar changelog = project.changelog @@ -168,4 +166,4 @@ modrinth{ } } -tasks.release.dependsOn(tasks.build, tasks.curseforge,tasks.modrinth) +tasks.release.dependsOn(tasks.build, tasks.curseforge, tasks.modrinth) diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java index f078cc98..fab9891e 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java @@ -5,6 +5,7 @@ import dcshadow.net.kyori.adventure.text.Component; import dcshadow.net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import de.erdbeerbaerlp.dcintegration.common.DiscordIntegration; +import de.erdbeerbaerlp.dcintegration.common.WorkThread; import de.erdbeerbaerlp.dcintegration.common.compat.DynmapListener; import de.erdbeerbaerlp.dcintegration.common.minecraftCommands.MCSubCommand; import de.erdbeerbaerlp.dcintegration.common.minecraftCommands.McCommandRegistry; @@ -160,7 +161,7 @@ public void playerJoin(final PlayerEvent.PlayerLoggedInEvent ev) { DiscordIntegration.INSTANCE.sendMessage(Localization.instance().playerJoin.replace("%player%", ForgeMessageUtils.formatPlayerName(p))); } // Fix link status (if user does not have role, give the role to the user, or vice versa) - final Thread fixLinkStatus = new Thread(() -> { + WorkThread.executeJob(() -> { if (Configuration.instance().linking.linkedRoleID.equals("0")) return; final UUID uuid = ev.getEntity().getUUID(); if (!LinkManager.isPlayerLinked(uuid)) return; @@ -172,8 +173,6 @@ public void playerJoin(final PlayerEvent.PlayerLoggedInEvent ev) { guild.addRoleToMember(member, linkedRole).queue(); } }); - fixLinkStatus.setDaemon(true); - fixLinkStatus.start(); } }