diff --git a/src/main/java/net/minecraftforge/fml/common/asm/transformers/TerminalTransformer.java b/src/main/java/net/minecraftforge/fml/common/asm/transformers/TerminalTransformer.java index a1d75d7ec..4edeee63d 100644 --- a/src/main/java/net/minecraftforge/fml/common/asm/transformers/TerminalTransformer.java +++ b/src/main/java/net/minecraftforge/fml/common/asm/transformers/TerminalTransformer.java @@ -134,11 +134,15 @@ public class TerminalTransformer implements IClassTransformer String callingClass = cause.length > 2 ? cause[3].getClassName() : "none"; String callingParent = cause.length > 3 ? cause[4].getClassName() : "none"; // FML is allowed to call system exit and the Minecraft applet (from the quit button), and the dedicated server (from itself) - if (!(callingClass.startsWith("net.minecraftforge.fml.") || - ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) || - ("net.minecraft.server.gui.MinecraftServerGui$1".equals(callingClass) && "java.awt.AWTEventMulticaster".equals(callingParent)) || - ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent))) - ) + boolean allowed = false; + allowed |= callingClass.startsWith("net.minecraftforge.fml."); + allowed |= callingClass.equals("net.minecraft.client.Minecraft") && callingParent.equals("net.minecraft.client.Minecraft"); + allowed |= callingClass.equals("net.minecraft.server.gui.MinecraftServerGui$1") && callingParent.equals("java.awt.AWTEventMulticaster"); + allowed |= callingClass.equals("net.minecraft.server.dedicated.DedicatedServer") && callingParent.equals("net.minecraft.server.MinecraftServer"); + allowed |= callingClass.equals("net.minecraft.server.dedicated.ServerHangWatchdog"); + allowed |= callingClass.equals("net.minecraft.server.dedicated.ServerHangWatchdog$1"); + + if (!allowed) { throw new ExitTrappedException(); }