CommonDMCC

This commit is contained in:
Xujiayao 2025-11-05 19:06:44 +08:00
parent 013557fdf4
commit 49291e2dd5
5 changed files with 11 additions and 11 deletions

View file

@ -1,6 +1,6 @@
package com.xujiayao.discord_mc_chat.client;
import com.xujiayao.discord_mc_chat.common.DMCC;
import com.xujiayao.discord_mc_chat.common.CommonDMCC;
import net.neoforged.fml.common.Mod;
/**
@ -15,6 +15,6 @@ public class NeoForgeDMCC {
* Start NeoForge DMCC.
*/
public NeoForgeDMCC() {
DMCC.init();
CommonDMCC.init();
}
}

View file

@ -23,7 +23,7 @@ import static com.xujiayao.discord_mc_chat.common.Constants.VERSION;
*
* @author Xujiayao
*/
public class DMCC {
public class CommonDMCC {
private static boolean shutdownHookAdded = false;
@ -103,7 +103,7 @@ public class DMCC {
if (!shutdownHookAdded) {
// Register shutdown hook for standalone mode
Runtime.getRuntime().addShutdownHook(new Thread(DMCC::shutdown, "DMCC-Shutdown"));
Runtime.getRuntime().addShutdownHook(new Thread(CommonDMCC::shutdown, "DMCC-Shutdown"));
shutdownHookAdded = true;
}

View file

@ -1,6 +1,6 @@
package com.xujiayao.discord_mc_chat.common.commands;
import com.xujiayao.discord_mc_chat.common.DMCC;
import com.xujiayao.discord_mc_chat.common.CommonDMCC;
import com.xujiayao.discord_mc_chat.common.utils.events.EventManager;
import com.xujiayao.discord_mc_chat.common.utils.i18n.I18nManager;
@ -20,7 +20,7 @@ public class CommandEventHandler {
public static void init() {
EventManager.register(CommandEvents.ReloadEvent.class, event -> new Thread(() -> {
LOGGER.info(I18nManager.getDmccTranslation("commands.reload.reloading"));
DMCC.reload();
CommonDMCC.reload();
}, "DMCC-Command").start());
EventManager.register(CommandEvents.StopEvent.class, event -> new Thread(() -> {
@ -28,7 +28,7 @@ public class CommandEventHandler {
if (IS_MINECRAFT_ENV) {
LOGGER.info("Run \"/dmcc start\" to start DMCC again");
DMCC.shutdown();
CommonDMCC.shutdown();
} else {
System.exit(0);
}

View file

@ -1,6 +1,6 @@
package com.xujiayao.discord_mc_chat.common.minecraft;
import com.xujiayao.discord_mc_chat.common.DMCC;
import com.xujiayao.discord_mc_chat.common.CommonDMCC;
import com.xujiayao.discord_mc_chat.common.utils.events.EventManager;
import static com.xujiayao.discord_mc_chat.common.Constants.LOGGER;
@ -18,7 +18,7 @@ public class MinecraftEventHandler {
public static void init() {
EventManager.register(MinecraftEvents.ServerStopped.class, event -> {
// Shutdown DMCC when the server is stopped
new Thread(DMCC::shutdown, "DMCC-Shutdown").start();
new Thread(CommonDMCC::shutdown, "DMCC-Shutdown").start();
});
EventManager.register(MinecraftEvents.CommandRegister.class, event -> {

View file

@ -1,6 +1,6 @@
package com.xujiayao.discord_mc_chat.server;
import com.xujiayao.discord_mc_chat.common.DMCC;
import com.xujiayao.discord_mc_chat.common.CommonDMCC;
/**
* The entry point for Standalone environment.
@ -15,6 +15,6 @@ public class StandaloneDMCC {
* @param args Command line arguments
*/
public static void main(String[] args) {
DMCC.init();
CommonDMCC.init();
}
}