-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
InsecurityManager.java
41 lines (34 loc) · 1019 Bytes
/
InsecurityManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package me.nallar.insecurity;
import java.security.Permission;
import java.util.logging.Handler;
import cpw.mods.fml.common.FMLLog;
import me.nallar.tickthreading.Log;
import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
public class InsecurityManager extends java.lang.SecurityManager {
static {
System.setSecurityManager(new InsecurityManager());
}
@SuppressWarnings ("EmptyMethod")
public static void init() {
}
@Override
public void checkPermission(Permission perm) {
}
@Override
public void checkPermission(Permission perm, Object context) {
}
@Override
public void checkExit(int status) {
super.checkExit(status);
if (MinecraftServer.getServer().isServerRunning()) {
Log.info("Server shutting down - requested at ", new ThisIsNotAnError());
}
for (Handler handler : FMLLog.getLogger().getHandlers()) {
handler.flush();
}
for (Handler handler : Log.LOGGER.getHandlers()) {
handler.flush();
}
}
}