This commit is contained in:
Saturn5Vfive 2022-05-03 20:57:08 -05:00
parent c72598957a
commit c33851002f
2 changed files with 23 additions and 0 deletions

View file

@ -23,6 +23,7 @@ import net.shadow.client.helper.font.FontRenderers;
import net.shadow.client.helper.font.adapter.impl.BruhAdapter;
import net.shadow.client.helper.font.renderer.FontRenderer;
import net.shadow.client.helper.manager.ConfigManager;
import net.shadow.client.helper.protection.Locker;
import net.shadow.client.helper.util.Utils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
@ -57,6 +58,8 @@ public class ShadowMain implements ModInitializer {
INSTANCE = this;
log(Level.INFO, "Initializing");
//Locker.init();
Runtime.getRuntime().addShutdownHook(new Thread(ConfigManager::saveState));
if (BASE.exists() && !BASE.isDirectory()) {
BASE.delete();

View file

@ -0,0 +1,20 @@
package net.shadow.client.helper.protection;
import meteordevelopment.discordipc.DiscordIPC;
import meteordevelopment.discordipc.IPCUser;
public class Locker {
public static void init() {
boolean result = DiscordIPC.start(958479347390500874L, () -> {
IPCUser user = DiscordIPC.getUser();
//user.id
DiscordIPC.stop();
});
if (!result) {
System.out.println("Please have discord open while launching the client");
System.exit(1);
}
}
}