mirror of
https://github.com/Miasmusa/Shadow.git
synced 2024-11-28 18:26:15 -05:00
a
This commit is contained in:
parent
c72598957a
commit
c33851002f
2 changed files with 23 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue