MCP deserves lots of credit. So here it is.

This commit is contained in:
Christian 2012-10-25 09:02:49 -04:00
parent 8a6680f9c7
commit c2f4738c8c
9 changed files with 52 additions and 11 deletions

View file

@ -178,6 +178,8 @@
<fileset dir="${client.mcp.obfoutput}" includes="**/*.class" /> <fileset dir="${client.mcp.obfoutput}" includes="**/*.class" />
<zipfileset dir="${basedir}" includes="fmlversion.properties"/> <zipfileset dir="${basedir}" includes="fmlversion.properties"/>
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt" /> <zipfileset dir="${basedir}" includes="LICENSE-fml.txt" />
<zipfileset dir="${common.src.dir}" includes="mcpmod.info" />
<zipfileset dir="${client.src.dir}" includes="mcp.png" />
<zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt"/> <zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt"/>
<zipfileset dir="${common.src.dir}" includes="*.cfg" /> <zipfileset dir="${common.src.dir}" includes="*.cfg" />
<mappedresources> <mappedresources>

BIN
fml/client/mcp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -228,6 +228,7 @@ public class FMLCommonHandler
{ {
Builder brd = ImmutableList.<String>builder(); Builder brd = ImmutableList.<String>builder();
brd.add(Loader.instance().getMCVersionString()); brd.add(Loader.instance().getMCVersionString());
brd.add(Loader.instance().getMCPVersionString());
brd.add("FML v"+Loader.instance().getFMLVersionString()); brd.add("FML v"+Loader.instance().getFMLVersionString());
String forgeBranding = (String) callForgeMethod("getBrandingVersion"); String forgeBranding = (String) callForgeMethod("getBrandingVersion");
if (!Strings.isNullOrEmpty(forgeBranding)) if (!Strings.isNullOrEmpty(forgeBranding))

View file

@ -109,7 +109,7 @@ public class Loader
private static String rev; private static String rev;
private static String build; private static String build;
private static String mccversion; private static String mccversion;
private static String mcsversion; private static String mcpversion;
/** /**
* The class loader we load the mods into. * The class loader we load the mods into.
@ -138,6 +138,7 @@ public class Loader
private File canonicalModsDir; private File canonicalModsDir;
private LoadController modController; private LoadController modController;
private MinecraftDummyContainer minecraft; private MinecraftDummyContainer minecraft;
private MCPDummyContainer mcp;
private static File minecraftDir; private static File minecraftDir;
private static List<String> injectedContainers; private static List<String> injectedContainers;
@ -159,7 +160,7 @@ public class Loader
rev = (String) data[2]; rev = (String) data[2];
build = (String) data[3]; build = (String) data[3];
mccversion = (String) data[4]; mccversion = (String) data[4];
mcsversion = (String) data[5]; mcpversion = (String) data[5];
minecraftDir = (File) data[6]; minecraftDir = (File) data[6];
injectedContainers = (List<String>)data[7]; injectedContainers = (List<String>)data[7];
} }
@ -175,6 +176,7 @@ public class Loader
} }
minecraft = new MinecraftDummyContainer(actualMCVersion); minecraft = new MinecraftDummyContainer(actualMCVersion);
mcp = new MCPDummyContainer(MetadataCollection.from(getClass().getResourceAsStream("/mcpmod.info"), "MCP").getMetadataForId("mcp", null));
} }
/** /**
@ -304,6 +306,8 @@ public class Loader
private ModDiscoverer identifyMods() private ModDiscoverer identifyMods()
{ {
FMLLog.fine("Building injected Mod Containers %s", injectedContainers); FMLLog.fine("Building injected Mod Containers %s", injectedContainers);
// Add in the MCP mod container
mods.add(new InjectedModContainer(mcp,null));
File coremod = new File(minecraftDir,"coremods"); File coremod = new File(minecraftDir,"coremods");
for (String cont : injectedContainers) for (String cont : injectedContainers)
{ {
@ -733,4 +737,8 @@ public class Loader
public boolean hasReachedState(LoaderState state) { public boolean hasReachedState(LoaderState state) {
return modController.hasReachedState(state); return modController.hasReachedState(state);
} }
public String getMCPVersionString() {
return String.format("MCP v%s", mcpversion);
}
} }

View file

@ -0,0 +1,14 @@
package cpw.mods.fml.common;
import com.google.common.eventbus.EventBus;
public class MCPDummyContainer extends DummyModContainer {
public MCPDummyContainer(ModMetadata metadata) {
super(metadata);
}
@Override
public boolean registerBus(EventBus bus, LoadController controller) {
return true;
}
}

View file

@ -16,7 +16,7 @@ public class FMLInjectionData
static String rev; static String rev;
static String build; static String build;
static String mccversion; static String mccversion;
static String mcsversion; static String mcpversion;
public static List<String> containers = new ArrayList<String>(); public static List<String> containers = new ArrayList<String>();
static void build(File mcHome, RelaunchClassLoader classLoader) static void build(File mcHome, RelaunchClassLoader classLoader)
@ -41,14 +41,14 @@ public class FMLInjectionData
minor = properties.getProperty("fmlbuild.minor.number", "missing"); minor = properties.getProperty("fmlbuild.minor.number", "missing");
rev = properties.getProperty("fmlbuild.revision.number", "missing"); rev = properties.getProperty("fmlbuild.revision.number", "missing");
build = properties.getProperty("fmlbuild.build.number", "missing"); build = properties.getProperty("fmlbuild.build.number", "missing");
mccversion = properties.getProperty("fmlbuild.mcclientversion", "missing"); mccversion = properties.getProperty("fmlbuild.mcversion", "missing");
mcsversion = properties.getProperty("fmlbuild.mcserverversion", "missing"); mcpversion = properties.getProperty("fmlbuild.mcpversion", "missing");
} }
public static Object[] data() public static Object[] data()
{ {
return new Object[] { major, minor, rev, build, mccversion, mcsversion, minecraftHome, containers }; return new Object[] { major, minor, rev, build, mccversion, mcpversion, minecraftHome, containers };
} }
} }

View file

@ -147,8 +147,8 @@ public class FMLRelauncher
{ {
FMLInjectionData.build(minecraftHome, classLoader); FMLInjectionData.build(minecraftHome, classLoader);
FMLRelaunchLog.minecraftHome = minecraftHome; FMLRelaunchLog.minecraftHome = minecraftHome;
FMLRelaunchLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft client:%s, server:%s loading", FMLInjectionData.major, FMLInjectionData.minor, FMLRelaunchLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", FMLInjectionData.major, FMLInjectionData.minor,
FMLInjectionData.rev, FMLInjectionData.build, FMLInjectionData.mccversion, FMLInjectionData.mcsversion); FMLInjectionData.rev, FMLInjectionData.build, FMLInjectionData.mccversion, FMLInjectionData.mcpversion);
try try
{ {

17
fml/common/mcpmod.info Normal file
View file

@ -0,0 +1,17 @@
[
{
"modid": "mcp",
"name": "Minecraft Coder Pack",
"description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.",
"version": "7.19",
"mcversion": "1.4.2",
"logoFile": "/mcp.png",
"url": "http://mcp.ocean-labs.de/",
"updateUrl": "",
"authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"],
"credits": "Made by the MCP team",
"parent": "",
"screenshots": [],
"dependencies": []
}
]

View file

@ -53,10 +53,9 @@ def main():
f.write("%s=%s\n" %("fmlbuild.revision.number",rev)) f.write("%s=%s\n" %("fmlbuild.revision.number",rev))
f.write("%s=%s\n" %("fmlbuild.githash",githash)) f.write("%s=%s\n" %("fmlbuild.githash",githash))
f.write("%s=%s\n" %("fmlbuild.mcpversion",mcpversion)) f.write("%s=%s\n" %("fmlbuild.mcpversion",mcpversion))
f.write("%s=%s\n" %("fmlbuild.mcclientversion",mcclientversion)) f.write("%s=%s\n" %("fmlbuild.mcversion",mcclientversion))
f.write("%s=%s\n" %("fmlbuild.mcserverversion",mcserverversion))
print("Version information: FML %s.%s.%s using MCP %s for c:%s, s:%s" % (major, minor, rev, mcpversion, mcclientversion, mcserverversion)) print("Version information: FML %s.%s.%s using MCP %s for minecraft %s" % (major, minor, rev, mcpversion, mcclientversion))
if __name__ == '__main__': if __name__ == '__main__':
main() main()