mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Slight reorganization of texture ticking - accomodate optifine
This commit is contained in:
1 parent
174d6691bd
commit
de8a5cfc8b
5 files changed
+33
-3
No files matched your search
@@ -23,6 +23,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -187,18 +188,20 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
ReflectionHelper.detectObfuscation(World.class);
|
||||
FMLCommonHandler.instance().registerSidedDelegate(this);
|
||||
FMLRegistry.registerRegistry(new ClientRegistry());
|
||||
Loader.instance().loadMods();
|
||||
try
|
||||
{
|
||||
Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
|
||||
optifineContainer = new OptifineModContainer(optifineConfig);
|
||||
ModMetadata optifineMetadata = readMetadataFrom(Loader.instance().getModClassLoader().getResourceAsStream("optifinemod.info"), optifineContainer);
|
||||
optifineContainer.setMetadata(optifineMetadata);
|
||||
FMLCommonHandler.instance().getFMLLogger().info(String.format("Forge Mod Loader has detected optifine %s, enabling compatibility features",optifineContainer.getVersion()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// OPTIFINE not found
|
||||
optifineContainer = null;
|
||||
}
|
||||
Loader.instance().loadMods();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1037,7 +1040,10 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
|
||||
try
|
||||
{
|
||||
effect.func_783_a();
|
||||
if (optifineContainer == null)
|
||||
{
|
||||
effect.func_783_a();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1098,4 +1104,15 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
mods.add(optifineContainer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAdditionalBrandingInformation()
|
||||
{
|
||||
if (optifineContainer!=null)
|
||||
{
|
||||
return Arrays.asList(String.format("Optifine %s",optifineContainer.getVersion()));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,6 +448,7 @@ public class FMLCommonHandler
|
||||
// Ignore- forge isn't loaded
|
||||
}
|
||||
}
|
||||
brandings.addAll(sidedDelegate.getAdditionalBrandingInformation());
|
||||
try {
|
||||
Properties props=new Properties();
|
||||
props.load(FMLCommonHandler.class.getClassLoader().getResourceAsStream("fmlbranding.properties"));
|
||||
|
||||
@@ -3,6 +3,7 @@ package cpw.mods.fml.common;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -24,4 +25,5 @@ public interface IFMLSidedHandler
|
||||
void profileStart(String profileLabel);
|
||||
void profileEnd();
|
||||
ModProperty getModLoaderPropertyFor(Field f);
|
||||
List<String> getAdditionalBrandingInformation();
|
||||
}
|
||||
@@ -174,6 +174,7 @@ public class Loader
|
||||
}
|
||||
|
||||
log.info(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", major, minor, rev, build, mcversion));
|
||||
modClassLoader = new ModClassLoader();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +367,6 @@ public class Loader
|
||||
}
|
||||
|
||||
state = State.LOADING;
|
||||
modClassLoader = new ModClassLoader();
|
||||
log.fine("Attempting to load mods contained in the minecraft jar file and associated classes");
|
||||
File[] minecraftSources=modClassLoader.getParentSources();
|
||||
if (minecraftSources.length==1 && minecraftSources[0].isFile()) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
@@ -635,4 +636,13 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see cpw.mods.fml.common.IFMLSidedHandler#getAdditionalBrandingInformation()
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAdditionalBrandingInformation()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user