Search in sources :

Example 1 with Java8VersionException

use of net.minecraftforge.fml.common.Java8VersionException in project MinecraftForge by MinecraftForge.

the class FMLClientHandler method beginMinecraftLoading.

/**
     * Called to start the whole game off
     *
     * @param minecraft The minecraft instance being launched
     * @param resourcePackList The resource pack list we will populate with mods
     * @param resourceManager The resource manager
     */
@SuppressWarnings("unchecked")
public void beginMinecraftLoading(Minecraft minecraft, List<IResourcePack> resourcePackList, IReloadableResourceManager resourceManager, MetadataSerializer metaSerializer) {
    detectOptifine();
    SplashProgress.start();
    client = minecraft;
    this.resourcePackList = resourcePackList;
    this.metaSerializer = metaSerializer;
    this.resourcePackMap = Maps.newHashMap();
    if (minecraft.isDemo()) {
        FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
        haltGame("FML will not run in demo mode", new RuntimeException());
        return;
    }
    List<String> injectedModContainers = FMLCommonHandler.instance().beginLoading(this);
    try {
        Loader.instance().loadMods(injectedModContainers);
    } catch (WrongMinecraftVersionException wrong) {
        wrongMC = wrong;
    } catch (DuplicateModsFoundException dupes) {
        dupesFound = dupes;
    } catch (Java8VersionException j8mods) {
        j8onlymods = j8mods;
    } catch (MissingModsException missing) {
        modsMissing = missing;
    } catch (ModSortingException sorting) {
        modSorting = sorting;
    } catch (CustomModLoadingErrorDisplayException custom) {
        FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt");
        customError = custom;
    } catch (MultipleModsErrored multiple) {
        multipleModsErrored = multiple;
    } catch (LoaderException le) {
        haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
        return;
    } finally {
        client.refreshResources();
    }
    try {
        Loader.instance().preinitializeMods();
    } catch (CustomModLoadingErrorDisplayException custom) {
        FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt");
        customError = custom;
    } catch (LoaderException le) {
        haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
        return;
    }
    Map<String, Map<String, String>> sharedModList = (Map<String, Map<String, String>>) Launch.blackboard.get("modList");
    if (sharedModList == null) {
        sharedModList = Maps.newHashMap();
        Launch.blackboard.put("modList", sharedModList);
    }
    for (ModContainer mc : Loader.instance().getActiveModList()) {
        Map<String, String> sharedModDescriptor = mc.getSharedModDescriptor();
        if (sharedModDescriptor != null) {
            String sharedModId = "fml:" + mc.getModId();
            sharedModList.put(sharedModId, sharedModDescriptor);
        }
    }
}
Also used : MultipleModsErrored(net.minecraftforge.fml.common.MultipleModsErrored) Java8VersionException(net.minecraftforge.fml.common.Java8VersionException) ForgeModContainer(net.minecraftforge.common.ForgeModContainer) ModContainer(net.minecraftforge.fml.common.ModContainer) DummyModContainer(net.minecraftforge.fml.common.DummyModContainer) DuplicateModsFoundException(net.minecraftforge.fml.common.DuplicateModsFoundException) LoaderException(net.minecraftforge.fml.common.LoaderException) ModSortingException(net.minecraftforge.fml.common.toposort.ModSortingException) WrongMinecraftVersionException(net.minecraftforge.fml.common.WrongMinecraftVersionException) MissingModsException(net.minecraftforge.fml.common.MissingModsException) Map(java.util.Map) BiMap(com.google.common.collect.BiMap) ImmutableMap(com.google.common.collect.ImmutableMap) HashBiMap(com.google.common.collect.HashBiMap)

Example 2 with Java8VersionException

use of net.minecraftforge.fml.common.Java8VersionException in project MinecraftForge by MinecraftForge.

the class FMLClientHandler method onInitializationComplete.

public void onInitializationComplete() {
    // re-sync TEXTURE_2D, splash screen disables it with a direct GL call
    GlStateManager.disableTexture2D();
    GlStateManager.enableTexture2D();
    if (wrongMC != null) {
        showGuiScreen(new GuiWrongMinecraft(wrongMC));
    } else if (j8onlymods != null) {
        showGuiScreen(new GuiJava8Error(j8onlymods));
    } else if (modsMissing != null) {
        showGuiScreen(new GuiModsMissing(modsMissing));
    } else if (dupesFound != null) {
        showGuiScreen(new GuiDupesFound(dupesFound));
    } else if (modSorting != null) {
        showGuiScreen(new GuiSortingProblem(modSorting));
    } else if (customError != null) {
        showGuiScreen(new GuiCustomModLoadingErrorScreen(customError));
    } else if (multipleModsErrored != null) {
        showGuiScreen(new GuiMultipleModsErrored(multipleModsErrored));
    } else {
        logMissingTextureErrors();
        if (!Loader.instance().java8) {
            if ((new Date()).getTime() >= ForgeModContainer.java8Reminder + (1000 * 60 * 60 * 24)) {
                showGuiScreen(new GuiJava8Error(new Java8VersionException(Collections.<ModContainer>emptyList())));
                ForgeModContainer.updateNag();
            }
        }
    }
}
Also used : Java8VersionException(net.minecraftforge.fml.common.Java8VersionException) Date(java.util.Date)

Example 3 with Java8VersionException

use of net.minecraftforge.fml.common.Java8VersionException in project MinecraftForge by MinecraftForge.

the class ForgeHooksClient method mainMenuMouseClick.

public static void mainMenuMouseClick(int mouseX, int mouseY, int mouseButton, FontRenderer font, int width) {
    if (!Loader.instance().java8) {
        if (mouseY >= (4 + (8 * 10)) && mouseY < (4 + (10 * 10))) {
            int w = font.getStringWidth(I18n.format("fml.messages.java8warning.1", TextFormatting.RED, TextFormatting.RESET));
            w = Math.max(w, font.getStringWidth(I18n.format("fml.messages.java8warning.2")));
            if (mouseX >= ((width - w) / 2) && mouseX <= ((width + w) / 2)) {
                FMLClientHandler.instance().showGuiScreen(new GuiJava8Error(new Java8VersionException(Collections.<ModContainer>emptyList())));
            }
        }
    }
}
Also used : Java8VersionException(net.minecraftforge.fml.common.Java8VersionException) GuiJava8Error(net.minecraftforge.fml.client.GuiJava8Error)

Aggregations

Java8VersionException (net.minecraftforge.fml.common.Java8VersionException)3 BiMap (com.google.common.collect.BiMap)1 HashBiMap (com.google.common.collect.HashBiMap)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 Date (java.util.Date)1 Map (java.util.Map)1 ForgeModContainer (net.minecraftforge.common.ForgeModContainer)1 GuiJava8Error (net.minecraftforge.fml.client.GuiJava8Error)1 DummyModContainer (net.minecraftforge.fml.common.DummyModContainer)1 DuplicateModsFoundException (net.minecraftforge.fml.common.DuplicateModsFoundException)1 LoaderException (net.minecraftforge.fml.common.LoaderException)1 MissingModsException (net.minecraftforge.fml.common.MissingModsException)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1 MultipleModsErrored (net.minecraftforge.fml.common.MultipleModsErrored)1 WrongMinecraftVersionException (net.minecraftforge.fml.common.WrongMinecraftVersionException)1 ModSortingException (net.minecraftforge.fml.common.toposort.ModSortingException)1