mirror of
https://github.com/JonasunderscoreJones/YetAnotherDiscordChatLink.git
synced 2025-10-22 16:29:19 +02:00
fixed log messages
Fixed "Server is starting up." Message Disabled "Server is stopping." Message Version bump
This commit is contained in:
parent
3be35808b6
commit
d0dcc98ac4
6 changed files with 10 additions and 7 deletions
|
@ -9,7 +9,7 @@ yarn_mappings=1.20.6+build.1
|
|||
loader_version=0.15.10
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.1.2
|
||||
mod_version=1.1.3
|
||||
maven_group=dev.jonasjones
|
||||
archives_base_name=yet-another-discord-chat-link
|
||||
|
||||
|
|
|
@ -26,7 +26,5 @@ public class YetAnotherDiscordChatLink implements ModInitializer {
|
|||
// Start the bot
|
||||
discordBot = new DiscordBot(ModConfigs.TOKEN, ModConfigs.CHANNEL_ID);
|
||||
discordBot.startBot();
|
||||
// send starting message
|
||||
sendToDiscord("Server is starting up.");
|
||||
}
|
||||
}
|
|
@ -69,6 +69,14 @@ public class DiscordBot extends ListenerAdapter {
|
|||
return;
|
||||
}
|
||||
isBotRunning = true;
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(1000); // janky solution to ensure that the message is being sent. Discord is a little slow sometimes
|
||||
sendToDiscord("Server is starting up.");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public static void stopBot() {
|
||||
|
|
|
@ -2,7 +2,6 @@ package dev.jonasjones.yadcl.mixin;
|
|||
|
||||
import dev.jonasjones.yadcl.config.ModConfigs;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
|
|
@ -8,7 +8,6 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import static dev.jonasjones.yadcl.dcbot.DiscordBot.sendToDiscord;
|
||||
import static dev.jonasjones.yadcl.dcbot.DiscordBot.stopBot;
|
||||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public class ServerStopMixin {
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"MixinServerPlayNetworkHandler",
|
||||
"PlayerManagerMixin",
|
||||
"ServerStopMixin"
|
||||
"PlayerManagerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue