Splash progress screen will not load in the presence of optifine anymore.

This commit is contained in:
cpw 2015-04-25 15:05:28 -04:00
parent 89daceb9eb
commit 46c5505565
2 changed files with 19 additions and 14 deletions

View file

@ -187,6 +187,7 @@ public class FMLClientHandler implements IFMLSidedHandler
@SuppressWarnings("unchecked")
public void beginMinecraftLoading(Minecraft minecraft, @SuppressWarnings("rawtypes") List resourcePackList, IReloadableResourceManager resourceManager)
{
detectOptifine();
SplashProgress.start();
client = minecraft;
this.resourcePackList = resourcePackList;
@ -201,19 +202,6 @@ public class FMLClientHandler implements IFMLSidedHandler
FMLCommonHandler.instance().beginLoading(this);
try
{
Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
String optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
Map<String,Object> dummyOptifineMeta = ImmutableMap.<String,Object>builder().put("name", "Optifine").put("version", optifineVersion).build();
ModMetadata optifineMetadata = MetadataCollection.from(getClass().getResourceAsStream("optifinemod.info"),"optifine").getMetadataForId("optifine", dummyOptifineMeta);
optifineContainer = new DummyModContainer(optifineMetadata);
FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features",optifineContainer.getVersion());
}
catch (Exception e)
{
optifineContainer = null;
}
try
{
Loader.instance().loadMods();
}
@ -279,6 +267,23 @@ public class FMLClientHandler implements IFMLSidedHandler
}
}
private void detectOptifine()
{
try
{
Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
String optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
Map<String,Object> dummyOptifineMeta = ImmutableMap.<String,Object>builder().put("name", "Optifine").put("version", optifineVersion).build();
ModMetadata optifineMetadata = MetadataCollection.from(getClass().getResourceAsStream("optifinemod.info"),"optifine").getMetadataForId("optifine", dummyOptifineMeta);
optifineContainer = new DummyModContainer(optifineMetadata);
FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features",optifineContainer.getVersion());
}
catch (Exception e)
{
optifineContainer = null;
}
}
@Override
public void haltGame(String message, Throwable t)
{

View file

@ -68,7 +68,7 @@ public class SplashProgress
private static ResourceLocation configLocation = new ResourceLocation("fml", "splash.properties");
private static final Properties config = loadConfig();
private static final boolean enabled = Boolean.parseBoolean(config.getProperty("enabled"));
private static final boolean enabled = Boolean.parseBoolean(config.getProperty("enabled")) && ! FMLClientHandler.instance().hasOptifine();
private static final boolean rotate = Boolean.parseBoolean(config.getProperty("rotate"));
private static final int logoOffset = getInt("logoOffset");
private static final int backgroundColor = getInt("background");