From 6f8409a2ce1c75933d4db29c647d38609a18f963 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Jul 2012 12:32:41 -0400 Subject: [PATCH 1/3] fix sided proxy bukkit test (not used so not a biggie) --- fml/common/cpw/mods/fml/common/ProxyInjector.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/ProxyInjector.java b/fml/common/cpw/mods/fml/common/ProxyInjector.java index fdf8f3e2c..7b16a552a 100644 --- a/fml/common/cpw/mods/fml/common/ProxyInjector.java +++ b/fml/common/cpw/mods/fml/common/ProxyInjector.java @@ -34,24 +34,24 @@ public class ProxyInjector this.bukkitName = bukkitName; this.target = target; } - + public boolean isValidFor(Side type) { if (type == Side.CLIENT) { return !this.clientName.isEmpty(); - } + } else if (type == Side.SERVER) { return !this.serverName.isEmpty(); } else if (type == Side.BUKKIT) { - return this.bukkitName.isEmpty(); + return !this.bukkitName.isEmpty(); } return false; } - + public void inject(ModContainer mod, Side side) { String targetType = side == Side.CLIENT ? clientName : serverName; From 0418f01886e58c2bde8292e23b48fe067700d96a Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Jul 2012 12:24:37 -0400 Subject: [PATCH 2/3] Harvest MC version from MCP --- fml/build.xml | 1 + fml/common/cpw/mods/fml/common/Loader.java | 18 ++++++++++-------- fml/getversion.py | 18 +++++++++++++++++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/fml/build.xml b/fml/build.xml index 785dffbe7..7a621fd60 100644 --- a/fml/build.xml +++ b/fml/build.xml @@ -26,6 +26,7 @@ + diff --git a/fml/common/cpw/mods/fml/common/Loader.java b/fml/common/cpw/mods/fml/common/Loader.java index 6e8e4c669..89db56017 100644 --- a/fml/common/cpw/mods/fml/common/Loader.java +++ b/fml/common/cpw/mods/fml/common/Loader.java @@ -92,7 +92,8 @@ public class Loader private static String minor; private static String rev; private static String build; - private static String mcversion; + private static String mccversion; + private static String mcsversion; /** * The {@link State} of the loader @@ -163,18 +164,19 @@ public class Loader if (stream != null) { try { properties.load(stream); - major = properties.getProperty("fmlbuild.major.number","none"); - minor = properties.getProperty("fmlbuild.minor.number","none"); - rev = properties.getProperty("fmlbuild.revision.number","none"); - build = properties.getProperty("fmlbuild.build.number","none"); - mcversion = properties.getProperty("fmlbuild.mcversion","none"); + major = properties.getProperty("fmlbuild.major.number","none"); + minor = properties.getProperty("fmlbuild.minor.number","none"); + rev = properties.getProperty("fmlbuild.revision.number","none"); + build = properties.getProperty("fmlbuild.build.number","none"); + mccversion = properties.getProperty("fmlbuild.mcclientversion","none"); + mcsversion = properties.getProperty("fmlbuild.mcserverversion","none"); } catch (IOException ex) { Loader.log.log(Level.SEVERE,"Could not get FML version information - corrupted installation detected!", ex); throw new LoaderException(ex); } } - log.info(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", major, minor, rev, build, mcversion)); + log.info(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft c:%s, s:%s loading", major, minor, rev, build, mccversion, mcsversion)); modClassLoader = new ModClassLoader(); } @@ -646,7 +648,7 @@ public class Loader public String getCrashInformation() { StringBuffer ret = new StringBuffer(); - for (String brand : FMLCommonHandler.instance().getBrandingStrings(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s", major, minor, rev, build, mcversion))) { + for (String brand : FMLCommonHandler.instance().getBrandingStrings(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s", major, minor, rev, build, mccversion))) { ret.append(brand).append("\n"); } for (ModContainer mod : mods) diff --git a/fml/getversion.py b/fml/getversion.py index c86354afe..ff3432e45 100644 --- a/fml/getversion.py +++ b/fml/getversion.py @@ -5,6 +5,15 @@ import fnmatch import re import subprocess, shlex +mcp_home = sys.argv[1] +mcp_dir = os.path.abspath(mcp_home) + +print(mcp_dir) +sys.path.append(mcp_dir) + +from runtime.commands import Commands +Commands._version_config = os.path.join(mcp_dir,Commands._version_config) + def cmdsplit(args): if os.sep == '\\': args = args.replace('\\', '\\\\') @@ -35,12 +44,19 @@ def main(): print("Git not found") vers="v1.0-0-deadbeef" (major,minor,rev,githash)=re.match("v(\d+).(\d+)-(\d+)-(.*)",vers).groups() + + (mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups() + with open("fmlversion.properties","w") as f: f.write("%s=%s\n" %("fmlbuild.major.number",major)) f.write("%s=%s\n" %("fmlbuild.minor.number",minor)) f.write("%s=%s\n" %("fmlbuild.revision.number",rev)) f.write("%s=%s\n" %("fmlbuild.githash",githash)) - f.write("%s=%s\n" %("fmlbuild.mcversion","1.2.5")) + f.write("%s=%s\n" %("fmlbuild.mcpversion",mcpversion)) + f.write("%s=%s\n" %("fmlbuild.mcclientversion",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)) if __name__ == '__main__': main() From 6c99b80b734488457190923be1b4dea63b4cab5c Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Jul 2012 15:16:40 -0400 Subject: [PATCH 3/3] Add in a setupenvironment ant target specifically for setting up an FML environment from scratch --- fml/build.xml | 85 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 23 deletions(-) diff --git a/fml/build.xml b/fml/build.xml index 7a621fd60..e6d0458d8 100644 --- a/fml/build.xml +++ b/fml/build.xml @@ -1,11 +1,11 @@ - The Forge Mod Loader @@ -26,10 +26,10 @@ - + - + @@ -68,7 +68,6 @@ - @@ -91,23 +90,23 @@ - - - - - - - - - - + + + + + + + + + + - - - + + + @@ -151,9 +150,9 @@ - + - + @@ -214,4 +213,44 @@ + + + + + + You have decided not to continue. This script will stop now. + Preparing the MCP environment at ${mcp.home} + + + + + + + + + + + + + + + Moving old patched sources at ${mcp.home}/src-work out of the way + + + + Deleting old patch references at ${mcp.home}/src-base + + Creating new patch references at ${mcp.home}/src-base + + + + Creating clean patch references at ${mcp.home}/src-work + + + + + + Setup complete! You should now be able to open ${basedir}/eclipse as a workspace in eclipse and import/refresh the FML-Server and FML-Client projects + +