Java 类cpw.mods.fml.relauncher.FMLSecurityManager.ExitTrappedException 实例源码

项目:TRHS_Club_Mod_2016    文件:TerminalTransformer.java   
private static void checkAccess()
{
    StackTraceElement[] cause = Thread.currentThread().getStackTrace();

    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("cpw.mods.fml.") ||
         ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
         ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
       )
    {
        throw new ExitTrappedException();
    }
}
项目:CauldronGit    文件:TerminalTransformer.java   
private static void checkAccess()
{
    StackTraceElement[] cause = Thread.currentThread().getStackTrace();

    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("cpw.mods.fml.") ||
         ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
         ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
       )
    {
        throw new ExitTrappedException();
    }
}
项目:Cauldron    文件:TerminalTransformer.java   
private static void checkAccess()
{
    StackTraceElement[] cause = Thread.currentThread().getStackTrace();

    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("cpw.mods.fml.") ||
         ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
         ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
       )
    {
        throw new ExitTrappedException();
    }
}
项目:Cauldron    文件:TerminalTransformer.java   
private static void checkAccess()
{
    StackTraceElement[] cause = Thread.currentThread().getStackTrace();

    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("cpw.mods.fml.") ||
         ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
         ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
       )
    {
        throw new ExitTrappedException();
    }
}
项目:Cauldron    文件:TerminalTransformer.java   
private static void checkAccess()
{
    StackTraceElement[] cause = Thread.currentThread().getStackTrace();

    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("cpw.mods.fml.") ||
         ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) ||
         ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))
       )
    {
        throw new ExitTrappedException();
    }
}