use of net.minecraftforge.fml.common.ModMetadata in project MinecraftForge by MinecraftForge.
the class FMLClientHandler method detectOptifine.
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();
InputStream optifineModInfoInputStream = getClass().getResourceAsStream("optifinemod.info");
try {
ModMetadata optifineMetadata = MetadataCollection.from(optifineModInfoInputStream, "optifine").getMetadataForId("optifine", dummyOptifineMeta);
optifineContainer = new DummyModContainer(optifineMetadata);
FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features", optifineContainer.getVersion());
} finally {
IOUtils.closeQuietly(optifineModInfoInputStream);
}
} catch (Exception e) {
optifineContainer = null;
}
}
use of net.minecraftforge.fml.common.ModMetadata in project MinecraftForge by MinecraftForge.
the class BlockStateMappingsTest method setup.
@BeforeClass
public static void setup() {
System.setProperty("fml.queryResult", "confirm");
System.setProperty("fml.doNotBackup", "true");
Loader.instance();
Bootstrap.register();
Loader.instance().setupTestHarness(new DummyModContainer(new ModMetadata() {
{
modId = "test";
}
}));
}
use of net.minecraftforge.fml.common.ModMetadata in project MinecraftForge by MinecraftForge.
the class SubstitutionInjectionTest method setup.
@BeforeClass
public static void setup() {
Loader.instance();
Bootstrap.register();
Loader.instance().setupTestHarness(new DummyModContainer(new ModMetadata() {
{
modId = "test";
}
}));
}
Aggregations