def soulforge_main(soulforge_dir, mcp_dir): sys.path.append(mcp_dir) from runtime.updatemd5 import updatemd5 from soulforge import decompile, apply_initial_patches, apply_soulforge_patches, reset_logger, copytree print '=============================== Soulforge Setup Start =====================================' print 'Decompiling' decompile(mcp_dir, soulforge_dir) print 'Applying patches' apply_initial_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, 'src'), True) os.chdir(mcp_dir) reset_logger() updatemd5(None, True, False, False) reset_logger() copytree(os.path.join(mcp_dir, 'src'), os.path.join(mcp_dir, 'src_base')) os.chdir(soulforge_dir) apply_soulforge_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, 'src'), True) print 'Copy external libraries' copytree(os.path.join(soulforge_dir, 'lib'), os.path.join(mcp_dir, 'lib')) print 'Setup workspace' if os.path.isdir(os.path.join(mcp_dir, 'eclipse')): shutil.rmtree(os.path.join(mcp_dir, 'eclipse')) copytree(os.path.join(soulforge_dir, 'soulforgedev', 'tmpworkspace'), os.path.join(mcp_dir, 'eclipse')) print '=============================== Soulforge Setup Finished ================================='
def soulforge_main(soulforge_dir, mcp_dir): sys.path.append(mcp_dir) from runtime.updatemd5 import updatemd5 from runtime.reobfuscate import reobfuscate from soulforge import ( decompile, apply_initial_patches, apply_soulforge_patches, recompile, unzipbtw, copyinitialreobfuscatedfiles, rezipbtw, apply_mod_patches, reset_logger, copytree, ) print "=============================== Soulforge Setup Start =====================================" print "Decompiling" decompile(mcp_dir, soulforge_dir) print "Applying patches" apply_initial_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, "src"), True) os.chdir(mcp_dir) updatemd5(None, True, False, False) reset_logger() os.chdir(soulforge_dir) apply_soulforge_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, "src"), True) copytree(os.path.join(soulforge_dir, "src", "minecraft"), os.path.join(mcp_dir, "src", "minecraft")) copytree(os.path.join(soulforge_dir, "src", "common"), os.path.join(mcp_dir, "src", "minecraft")) copytree(os.path.join(soulforge_dir, "src", "minecraft_server"), os.path.join(mcp_dir, "src", "minecraft_server")) copytree(os.path.join(soulforge_dir, "src", "common"), os.path.join(mcp_dir, "src", "minecraft_server")) print "Copy external libraries" copytree(os.path.join(soulforge_dir, "lib"), os.path.join(mcp_dir, "lib")) os.chdir(mcp_dir) print "Recompiling" recompile(None, False, False) reset_logger() print "Reobfuscating" reobfuscate(None, False, False, False, False, False, False) reset_logger() print "Unzipping BTW" unzipbtw(soulforge_dir) print "Copying Reobfuscated Files" copyinitialreobfuscatedfiles(soulforge_dir, mcp_dir) print "Rezipping Files" rezipbtw(soulforge_dir) updatemd5(None, True, False, False) reset_logger() os.chdir(soulforge_dir) copytree(os.path.join(mcp_dir, "src"), os.path.join(mcp_dir, "src_base")) apply_mod_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, "src"), True) print "Setup workspace" if os.path.isdir(os.path.join(mcp_dir, "eclipse")): shutil.rmtree(os.path.join(mcp_dir, "eclipse")) copytree(os.path.join(soulforge_dir, "addondev", "tmpworkspace"), os.path.join(mcp_dir, "eclipse")) print "=============================== Soulforge Setup Finished ================================="
def soulforge_main(soulforge_dir, mcp_dir): sys.path.append(mcp_dir) from runtime.updatemd5 import updatemd5 from runtime.reobfuscate import reobfuscate from soulforge import decompile, apply_initial_patches, apply_soulforge_patches, recompile, unzipbtw, copyinitialreobfuscatedfiles, rezipbtw, apply_mod_patches, reset_logger, copytree print '=============================== Soulforge Setup Start =====================================' print 'Decompiling' decompile(mcp_dir, soulforge_dir) print 'Applying patches' apply_initial_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, 'src'), True) os.chdir(mcp_dir) updatemd5(None, True, False, False) reset_logger() os.chdir(soulforge_dir) apply_soulforge_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, 'src'), True) copytree(os.path.join(soulforge_dir, 'src', 'minecraft'), os.path.join(mcp_dir, 'src', 'minecraft')) copytree(os.path.join(soulforge_dir, 'src', 'common'), os.path.join(mcp_dir, 'src', 'minecraft')) copytree(os.path.join(soulforge_dir, 'src', 'minecraft_server'), os.path.join(mcp_dir, 'src', 'minecraft_server')) copytree(os.path.join(soulforge_dir, 'src', 'common'), os.path.join(mcp_dir, 'src', 'minecraft_server')) print 'Copy external libraries' copytree(os.path.join(soulforge_dir, 'lib'), os.path.join(mcp_dir, 'lib')) os.chdir(mcp_dir) print 'Recompiling' recompile(None, False, False) reset_logger() print 'Reobfuscating' reobfuscate(None, False, False, False, False, False, False) reset_logger() print 'Unzipping BTW' unzipbtw(soulforge_dir) print 'Copying Reobfuscated Files' copyinitialreobfuscatedfiles(soulforge_dir, mcp_dir) print 'Rezipping Files' rezipbtw(soulforge_dir) updatemd5(None, True, False, False) reset_logger() os.chdir(soulforge_dir) copytree(os.path.join(mcp_dir, 'src'), os.path.join(mcp_dir, 'src_base')) apply_mod_patches(mcp_dir, soulforge_dir, os.path.join(mcp_dir, 'src'), True) print 'Setup workspace' if os.path.isdir(os.path.join(mcp_dir, 'eclipse')): shutil.rmtree(os.path.join(mcp_dir, 'eclipse')) copytree(os.path.join(soulforge_dir, 'addondev', 'tmpworkspace'), os.path.join(mcp_dir, 'eclipse')) print '=============================== Soulforge Setup Finished ================================='