Re-wrote/orginized a lot of fml.py. Almost everything is re-written/moved.
This is done in preperation for MCP to roll out SpecialSource support and the new 1.6 structure. Also done for my sanity while reading through the code. Intruduced a new function. If there is a 'mcp_data' folder in the FML folder, it will be copied to the MCP work directory after MCP is extracted. It DOES overwrite anything that already exists. This is intended for places like BuildServer to place libraries/assets to prevent them from needing to be downloaded every version. Introduced a dev-env json. Need to write the eclipse workspace references to the new libraries. Out custom json includes asm and legacylauncher. Added proper OptionParsing to decompile.py
This commit is contained in:
parent
611c3b9591
commit
90c643183e
12 changed files with 1233 additions and 1147 deletions
1
fml/.gitignore
vendored
1
fml/.gitignore
vendored
|
@ -13,3 +13,4 @@ fmlbranding.properties
|
|||
/eclipse
|
||||
/deobfuscation_data*.zip
|
||||
/binpatch
|
||||
/mcp_data/
|
||||
|
|
|
@ -79,8 +79,11 @@
|
|||
<target name="clean" depends="buildenvsetup,makeclean" if="mcp.exists">
|
||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="--mcp-dir" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="--fml-dir" />
|
||||
<arg value="${basedir}" />
|
||||
<arg value="--gen-conf" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
@ -268,7 +271,9 @@
|
|||
<target name="fmldecompile" depends="buildenvsetup,makeclean">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="--mcp-dir" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="--fml-dir" />
|
||||
<arg value="${basedir}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
@ -276,9 +281,10 @@
|
|||
<target name="jenkinsfmldecompile" depends="buildenvsetup,makeclean">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="--mcp-dir" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="--fml-dir" />
|
||||
<arg value="${basedir}" />
|
||||
<arg value="-no_gen_conf" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -1,125 +1,15 @@
|
|||
--- commands.py
|
||||
+++ commands.py
|
||||
@@ -58,6 +58,8 @@
|
||||
|
||||
|
||||
def reallyrmtree(path):
|
||||
+ if os.path.isfile(os.path.join(path, 'asm-4.1.tar.gz')): #Check if asm exists, indicating the libs folder, if so, don't delete it
|
||||
+ return
|
||||
if not sys.platform.startswith('win'):
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
@@ -139,6 +141,8 @@
|
||||
@@ -142,6 +142,8 @@
|
||||
fieldnames = csvreader.fieldnames
|
||||
return set(fieldnames)
|
||||
|
||||
+def commands_sanity_check():
|
||||
+ print 'Commands patch applied successfully'
|
||||
+ print ' Commands patch applied successfully'
|
||||
|
||||
class Commands(object):
|
||||
"""Contains the commands and initialisation for a full mcp run"""
|
||||
@@ -194,6 +198,7 @@
|
||||
sys.exit(1)
|
||||
|
||||
self.checkjava()
|
||||
+ self.checkscala()
|
||||
self.readcommands(verify, no_patch=no_patch)
|
||||
|
||||
def checkcommand(self, name, command, java=False, single_line=False, check_return=True, error=True):
|
||||
@@ -230,6 +235,9 @@
|
||||
self.checkcommand('java', '%s -version' % self.cmdjava)
|
||||
self.checkcommand('javac', '%s -version' % self.cmdjavac)
|
||||
self.checkcommand('javac runtime', '%s -J-version' % self.cmdjavac)
|
||||
+ if self.cmdscalac:
|
||||
+ self.checkcommand('scalac', '%s -version' % self.cmdscalac)
|
||||
+ self.checkcommand('scalac runtime', '%s -J-version' % self.cmdscalac)
|
||||
self.checkcommand('retroguard', '%s --version' % self.retroguard, java=True)
|
||||
|
||||
self.exceptor = os.path.normpath(self.config.get('COMMANDS', 'Exceptor'))
|
||||
@@ -268,6 +276,24 @@
|
||||
self.astyle = os.path.normpath(self.config.get('COMMANDS', 'AStyle_%s' % self.osname))
|
||||
if verify:
|
||||
self.has_astyle = self.checkcommand('astyle', '%s --version' % self.astyle, error=False)
|
||||
+
|
||||
+ if verify:
|
||||
+ output = self.runcmd('%s --version' % self.astyle).rstrip().split(' ')
|
||||
+ try:
|
||||
+ version = output[len(output) - 1].split('.')
|
||||
+ if int(version[0]) >= 2 and int(version[1]) >= 0:
|
||||
+ self.has_astyle = True
|
||||
+ else:
|
||||
+ self.logger.error('!! Astyle version out of date, 2.0+ required found: \"%s\"' % output[len(output) - 1])
|
||||
+ self.as_astyle = False
|
||||
+ except:
|
||||
+ self.logger.error('!! Could not extract astyle version information !!')
|
||||
+ self.logger.error(sys.exc_info()[0])
|
||||
+ self.has_astyle = False
|
||||
+
|
||||
+ if not self.has_astyle:
|
||||
+ self.logger.error('!! astyle is needed for FML, can not continue !!')
|
||||
+ sys.exit(1)
|
||||
|
||||
# only check jad and jadretro if we can use it
|
||||
if self.jad:
|
||||
@@ -324,6 +350,8 @@
|
||||
reqs.append('astyle')
|
||||
if self.has_astyle_cfg:
|
||||
reqs.append('astyle config')
|
||||
+ if self.cmdscalac:
|
||||
+ reqs.append('scalac')
|
||||
self.logger.info('# found %s', ', '.join(reqs))
|
||||
if not self.has_jad_patch and not no_patch:
|
||||
self.has_jad = False
|
||||
@@ -350,6 +378,13 @@
|
||||
self.cmdfernflower = self.config.get('COMMANDS', 'CmdFernflower', raw=1) % (self.cmdjava, self.fernflower)
|
||||
self.cmdexceptor = self.config.get('COMMANDS', 'CmdExceptor', raw=1) % (self.cmdjava, self.exceptor)
|
||||
self.cmdrecomp = self.config.get('COMMANDS', 'CmdRecomp', raw=1) % self.cmdjavac
|
||||
+ try:
|
||||
+ if self.cmdscalac:
|
||||
+ self.cmdrecompscalac = self.config.get('COMMANDS', 'CmdRecompScalac', raw=1) % self.cmdscalac
|
||||
+ else:
|
||||
+ self.cmdrecompscalac = None
|
||||
+ except ConfigParser.NoOptionError:
|
||||
+ pass
|
||||
self.cmdstartsrv = self.config.get('COMMANDS', 'CmdStartSrv', raw=1) % self.cmdjava
|
||||
self.cmdstartclt = self.config.get('COMMANDS', 'CmdStartClt', raw=1) % self.cmdjava
|
||||
|
||||
@@ -753,6 +788,34 @@
|
||||
self.cmdjavac = '"%s"' % os.path.join(results[0], 'javac')
|
||||
self.cmdjava = '"%s"' % os.path.join(results[0], 'java')
|
||||
|
||||
+ def checkscala(self):
|
||||
+ cmd = None
|
||||
+ try:
|
||||
+ # TODO: Verify at least version 2.10
|
||||
+ self.runcmd('scalac -version', quiet=True)
|
||||
+ cmd = 'scalac'
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ pass
|
||||
+ if cmd is None: # Stupid windows...
|
||||
+ try:
|
||||
+ # TODO: Verify at least version 2.10
|
||||
+ self.runcmd('scalac.bat -version', quiet=True)
|
||||
+ cmd = 'scalac.bat'
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ pass
|
||||
+
|
||||
+ if cmd is None:
|
||||
+ self.logger.warning('"scalac" is not found on the PATH. Scala files will not be recompiled')
|
||||
+ self.cmdscalac = None
|
||||
+ else:
|
||||
+ self.cmdscalac = '"%s"' % cmd
|
||||
+
|
||||
+ try:
|
||||
+ self.runcmd('%s -target:jvm-1.6 -version' % self.cmdscalac, quiet=True)
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ self.logger.info('%s does not support jvm-1.6 target, it is out of date. Ignoring' % self.cmdscalac)
|
||||
+ self.cmdscalac = None
|
||||
+
|
||||
def checkjars(self, side):
|
||||
jarlk = {CLIENT: self.jarclient, SERVER: self.jarserver}
|
||||
md5jarlk = {CLIENT: self.md5jarclt, SERVER: self.md5jarsrv}
|
||||
@@ -798,6 +861,8 @@
|
||||
@@ -980,6 +982,8 @@
|
||||
binlk = {CLIENT: self.binclient, SERVER: self.binserver}
|
||||
testlk = {CLIENT: self.testclient, SERVER: self.testserver}
|
||||
|
||||
|
@ -128,7 +18,7 @@
|
|||
if not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))):
|
||||
return False
|
||||
return True
|
||||
@@ -1038,6 +1103,9 @@
|
||||
@@ -1311,6 +1315,9 @@
|
||||
pathbinlk = {CLIENT: self.binclient, SERVER: self.binserver}
|
||||
pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver}
|
||||
pathlog = {CLIENT: self.clientrecomplog, SERVER: self.serverrecomplog}
|
||||
|
@ -138,46 +28,7 @@
|
|||
|
||||
if not os.path.exists(pathbinlk[side]):
|
||||
os.makedirs(pathbinlk[side])
|
||||
@@ -1051,6 +1119,29 @@
|
||||
all_files = True
|
||||
append_pattern = False
|
||||
pkglist = filterdirs(pathsrclk[side], '*.java', append_pattern=append_pattern, all_files=all_files)
|
||||
+ if self.cmdrecompscalac: # Compile scala before java as scala scans java files, but not vice-versa
|
||||
+ pkglistscala = pkglist[:]
|
||||
+ pkglistscala.extend(filterdirs(pathsrclk[side], '*.scala', append_pattern=append_pattern, all_files=all_files))
|
||||
+ dirs = ' '.join(pkglistscala)
|
||||
+ classpath = os.pathsep.join(cplk[side])
|
||||
+ forkcmd = self.cmdrecompscalac.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side], pkgs=dirs)
|
||||
+ try:
|
||||
+ self.runcmd(forkcmd, log_file=pathlog[side])
|
||||
+ except CalledProcessError as ex:
|
||||
+ self.logger.error('')
|
||||
+ self.logger.error('== ERRORS FOUND in SCALA CODE ==')
|
||||
+ self.logger.error('')
|
||||
+ for line in ex.output.splitlines():
|
||||
+ if line.strip():
|
||||
+ if line.find("jvm-1.6") != -1:
|
||||
+ self.logger.error(' === Your scala version is out of date, update to at least 2.10.0 ===')
|
||||
+ if line[0] != '[' and line[0:4] != 'Note':
|
||||
+ self.logger.error(line)
|
||||
+ if '^' in line:
|
||||
+ self.logger.error('')
|
||||
+ self.logger.error('================================')
|
||||
+ self.logger.error('')
|
||||
+ raise
|
||||
dirs = ' '.join(pkglist)
|
||||
classpath = os.pathsep.join(cplk[side])
|
||||
forkcmd = self.cmdrecomp.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side],
|
||||
@@ -1059,7 +1150,7 @@
|
||||
self.runcmd(forkcmd, log_file=pathlog[side])
|
||||
except CalledProcessError as ex:
|
||||
self.logger.error('')
|
||||
- self.logger.error('== ERRORS FOUND ==')
|
||||
+ self.logger.error('== ERRORS FOUND in JAVA CODE ==')
|
||||
self.logger.error('')
|
||||
for line in ex.output.splitlines():
|
||||
if line.strip():
|
||||
@@ -1072,7 +1163,7 @@
|
||||
@@ -1368,7 +1375,7 @@
|
||||
raise
|
||||
|
||||
def startserver(self):
|
||||
|
@ -186,7 +37,7 @@
|
|||
classpath = [os.path.join('..', p) for p in classpath]
|
||||
classpath = os.pathsep.join(classpath)
|
||||
os.chdir(self.dirjars)
|
||||
@@ -1080,7 +1171,7 @@
|
||||
@@ -1376,7 +1383,7 @@
|
||||
self.runmc(forkcmd)
|
||||
|
||||
def startclient(self):
|
||||
|
@ -195,47 +46,7 @@
|
|||
classpath = [os.path.join('..', p) for p in classpath]
|
||||
classpath = os.pathsep.join(classpath)
|
||||
natives = os.path.join('..', self.dirnatives)
|
||||
@@ -1207,20 +1298,20 @@
|
||||
with open(self.csvmethods, 'rb') as fh:
|
||||
methodsreader = csv.DictReader(fh)
|
||||
for row in methodsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
if row['name'] != row['searge']:
|
||||
names['methods'][row['searge']] = row['name']
|
||||
with open(self.csvfields, 'rb') as fh:
|
||||
fieldsreader = csv.DictReader(fh)
|
||||
for row in fieldsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
if row['name'] != row['searge']:
|
||||
names['fields'][row['searge']] = row['name']
|
||||
if self.has_param_csv:
|
||||
with open(self.csvparams, 'rb') as fh:
|
||||
paramsreader = csv.DictReader(fh)
|
||||
for row in paramsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
names['params'][row['param']] = row['name']
|
||||
|
||||
regexps = {
|
||||
@@ -1354,13 +1445,13 @@
|
||||
methods = {}
|
||||
for row in methodsreader:
|
||||
#HINT: Only include methods that have a non-empty description
|
||||
- if int(row['side']) == side and row['desc']:
|
||||
+ if (int(row['side']) == side or int(row['side']) == 2) and row['desc']:
|
||||
methods[row['searge']] = row['desc'].replace('*/', '* /')
|
||||
|
||||
fields = {}
|
||||
for row in fieldsreader:
|
||||
#HINT: Only include fields that have a non-empty description
|
||||
- if int(row['side']) == side and row['desc']:
|
||||
+ if (int(row['side']) == side or int(row['side']) == 2) and row['desc']:
|
||||
fields[row['searge']] = row['desc'].replace('*/', '* /')
|
||||
|
||||
regexps = {
|
||||
@@ -1437,7 +1528,7 @@
|
||||
@@ -1733,7 +1740,7 @@
|
||||
self.runcmd(forkcmd)
|
||||
return True
|
||||
|
||||
|
@ -244,7 +55,7 @@
|
|||
if not reobf:
|
||||
md5lk = {CLIENT: self.md5client, SERVER: self.md5server}
|
||||
else:
|
||||
@@ -1452,6 +1543,9 @@
|
||||
@@ -1748,6 +1755,9 @@
|
||||
class_path = ''
|
||||
else:
|
||||
class_path += '/'
|
||||
|
@ -254,40 +65,7 @@
|
|||
for class_file in fnmatch.filter(filelist, '*.class'):
|
||||
class_name = class_path + os.path.splitext(class_file)[0]
|
||||
bin_file = os.path.normpath(os.path.join(path, class_file))
|
||||
@@ -1548,6 +1642,8 @@
|
||||
if not os.path.exists(outpathlk[side]):
|
||||
os.makedirs(outpathlk[side])
|
||||
|
||||
+ reserved = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9']
|
||||
+
|
||||
# HINT: We extract the modified class files
|
||||
with closing(zipfile.ZipFile(jarlk[side])) as zipjar:
|
||||
for in_class in trgclasses:
|
||||
@@ -1561,6 +1657,23 @@
|
||||
out_class = out_class.replace(self.nullpkg, '')
|
||||
if out_class[0] == '/':
|
||||
out_class = out_class[1:]
|
||||
+
|
||||
+ rename = False
|
||||
+ for res in reserved:
|
||||
+ if out_class.upper().startswith(res):
|
||||
+ rename = True
|
||||
+ break
|
||||
+
|
||||
+ if rename:
|
||||
+ try:
|
||||
+ f = open(os.path.join(outpathlk[side], '_' + out_class), 'wb')
|
||||
+ f.write(zipjar.read(out_class))
|
||||
+ f.close()
|
||||
+ self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], '_' + out_class)
|
||||
+ except IOError:
|
||||
+ self.logger.error('* File %s failed extracting for %s', out_class, in_class)
|
||||
+ continue
|
||||
+
|
||||
try:
|
||||
zipjar.extract(out_class, outpathlk[side])
|
||||
self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], out_class)
|
||||
@@ -1607,6 +1720,9 @@
|
||||
@@ -1920,6 +1930,9 @@
|
||||
sys.exit(1)
|
||||
|
||||
for entry in newfiles:
|
||||
|
@ -297,7 +75,7 @@
|
|||
if entry[3] == 'U':
|
||||
self.logger.info('Retrieving file from server : %s', entry[0])
|
||||
cur_file = os.path.normpath(entry[0])
|
||||
@@ -1627,6 +1743,9 @@
|
||||
@@ -1940,6 +1953,9 @@
|
||||
md5reoblk = {CLIENT: self.md5reobfclient, SERVER: self.md5reobfserver}
|
||||
outpathlk = {CLIENT: self.srcmodclient, SERVER: self.srcmodserver}
|
||||
src = {CLIENT: self.srcclient, SERVER: self.srcserver}
|
||||
|
|
|
@ -72,9 +72,8 @@ public class MCPMerger
|
|||
File map_file = new File(args[0]);
|
||||
File client_jar = new File(args[1]);
|
||||
File server_jar = new File(args[2]);
|
||||
File client_jar_tmp = new File(args[1] + ".MergeBack");
|
||||
File server_jar_tmp = new File(args[2] + ".MergeBack");
|
||||
|
||||
File client_jar_tmp = new File(args[1] + ".backup_merge");
|
||||
File server_jar_tmp = new File(args[2] + ".backup_merge");
|
||||
|
||||
if (client_jar_tmp.exists() && !client_jar_tmp.delete())
|
||||
{
|
||||
|
|
|
@ -34,12 +34,12 @@ ReobfClientSrg = %(DirTemp)s/client_ro_srg.srg
|
|||
ReobfServerSrg = %(DirTemp)s/server_ro_srg.srg
|
||||
|
||||
[JAR]
|
||||
DirNatives = %(DirJars)s/bin/natives
|
||||
Client = %(DirJars)s/bin/minecraft.jar
|
||||
Server = %(DirJars)s/minecraft_server.jar
|
||||
LWJGL = %(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
|
||||
MD5Client = 6897c3287fb971c9f362eb3ab20f5ddd
|
||||
MD5Server = c4e1bf89e834bd3670c7bf8f13874bc6
|
||||
DirNatives = %(DirJars)s/versions/1.6/natives
|
||||
Json = %(DirJars)s/versions/1.6/1.6.json
|
||||
Client = %(DirJars)s/versions/1.6/1.6.jar
|
||||
Server = %(DirJars)s/minecraft_server.1.6.jar
|
||||
MD5Client = 6a64a2136e3a3fe4d29b0a0df30b25fc
|
||||
MD5Server = 7c03305c8bf97a8e8f3cdb147fc90607
|
||||
|
||||
[RETROGUARD]
|
||||
Location = %(DirRuntime)s/bin/retroguard.jar
|
||||
|
@ -71,6 +71,8 @@ ClsServerTemp = %(DirTempCls)s/minecraft_server
|
|||
SrcClientTemp = %(DirTempSrc)s/minecraft
|
||||
SrcServerTemp = %(DirTempSrc)s/minecraft_server
|
||||
FFSource = net
|
||||
FFClientIn = %(DirTemp)s/minecraft_ff_in.jar
|
||||
FFServerIn = %(DirTemp)s/minecraft_server_ff_in.jar
|
||||
|
||||
[OUTPUT]
|
||||
BinClientTemp = %(DirTempBin)s/minecraft
|
||||
|
@ -94,11 +96,11 @@ BinClient = %(DirBin)s/minecraft
|
|||
BinServer = %(DirBin)s/minecraft_server
|
||||
LogClient = %(DirLogs)s/client_compile.log
|
||||
LogServer = %(DirLogs)s/server_compile.log
|
||||
ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/bin/minecraft.jar,%(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
|
||||
ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar
|
||||
ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/versions/1.6/1.6.jar
|
||||
ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.1.6.jar
|
||||
ClientFixes = %(DirConf)s/patches
|
||||
FixStart = Start
|
||||
IgnorePkg = paulscode,com/jcraft,isom,ibxm,de/matthiasmann/twl,org/xmlpull,javax/xml,com/fasterxml,javax/ws,org/bouncycastle,argo
|
||||
IgnorePkg = paulscode,com,isom,ibxm,de/matthiasmann/twl,org,javax/xml,javax/ws,argo
|
||||
|
||||
[REOBF]
|
||||
MD5Client = %(DirTemp)s/client.md5
|
||||
|
@ -125,8 +127,8 @@ LogFile = %(DirLogs)s/mcp.log
|
|||
LogFileErr = %(DirLogs)s/mcperr.log
|
||||
UpdateUrl =
|
||||
IgnoreUpdate = %(DirBin)s,%(DirLib)s,%(DirLogs)s,%(DirModSrc)s,%(DirReobf)s,%(DirSrc)s,%(DirTemp)s,%(DirEclipse)s/Client/bin,%(DirEclipse)s/Server/bin,%(DirJars)s/world,%(DirJars)s/saves,%(DirJars)s/resources
|
||||
RGIndex = 104000
|
||||
ParamIndex = 23000
|
||||
RGIndex = 130000
|
||||
ParamIndex = 30000
|
||||
|
||||
[ASTYLE]
|
||||
AstyleConfig = %(DirConf)s/astyle.cfg
|
||||
|
@ -144,15 +146,18 @@ AStyle_osx = %(DirRuntime)s/bin/astyle-osx
|
|||
JadRetro = %(DirRuntime)s/bin/jadretro.jar
|
||||
Fernflower = %(DirRuntime)s/bin/fernflower.jar
|
||||
Exceptor = %(DirRuntime)s/bin/mcinjector.jar
|
||||
SpecialSource = %(DirRuntime)s/bin/specialsource.jar
|
||||
CmdPatch = %s -p1 -u -i {patchfile} -d {srcdir}
|
||||
CmdJad = %s -b -d {outdir} -dead -o -r -s .java -stat -ff {classes}
|
||||
CmdAStyle = %s --suffix=none --quiet --options={conffile} {classes}
|
||||
CmdRG = %s -cp "{classpath}" RetroGuard -searge {conffile}
|
||||
CmdRGReobf = %s -cp "{classpath}" RetroGuard -notch {conffile}
|
||||
CmdSS = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -m {mapfile} --kill-source
|
||||
CmdSSReobf = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -r -m {mapfile} -d {identifier} -e %s
|
||||
CmdJadretro = %s -jar %s {targetdir}
|
||||
CmdFernflower = %s -Xmx512M -jar %s -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
|
||||
CmdExceptor = %s -jar %s {input} {output} {conf} {log}
|
||||
CmdRecomp = %s -encoding UTF-8 -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdRecompScalac = %s -encoding UTF-8 -deprecation -target:jvm-1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdRecompScala = %s -encoding UTF-8 -deprecation -target:jvm-1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer
|
||||
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start
|
||||
|
|
|
@ -2,19 +2,23 @@ import urllib
|
|||
import zipfile
|
||||
import sys
|
||||
import os
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not len(sys.argv) >= 3:
|
||||
print 'Invalid arguments, must supply mcp folder and fml folder: decompile.py <MCPFolder> <FMLFolder>'
|
||||
parser = OptionParser()
|
||||
parser.add_option('-g', '--gen-conf', action="store_true", dest='gen_conf', help='Generate merged MCP conf folder', default=False)
|
||||
parser.add_option('-m', '--mcp-dir', action='store', dest='mcp_dir', help='Path to download/extract MCP to', default=None )
|
||||
parser.add_option('-f', '--fml-dir', action='store', dest='fml_dir', help='Path to FML install folder', default=None )
|
||||
options, _ = parser.parse_args()
|
||||
|
||||
if options.fml_dir is None or options.mcp_dir is None:
|
||||
print 'Invalid arguments, must supply mcp folder and fml folder: decompile.py --mcp-dir <MCPFolder> --fml-dir <FMLFolder>'
|
||||
else:
|
||||
mcp_dir = os.path.abspath(sys.argv[1])
|
||||
fml_dir = os.path.abspath(sys.argv[2])
|
||||
dont_gen_conf = '-no_gen_conf' in sys.argv
|
||||
sys.path.append(os.path.join(options.fml_dir, 'install'))
|
||||
|
||||
sys.path.append(os.path.join(fml_dir, 'install'))
|
||||
from fml import decompile_minecraft, setup_mcp, download_mcp
|
||||
|
||||
from fml import setup_fml, setup_mcp
|
||||
|
||||
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
||||
setup_fml(fml_dir, mcp_dir)
|
||||
download_mcp(fml_dir=options.fml_dir, mcp_dir=options.mcp_dir)
|
||||
setup_mcp(options.fml_dir, options.mcp_dir, gen_conf=options.gen_conf)
|
||||
decompile_minecraft(options.fml_dir, options.mcp_dir)
|
||||
|
|
1810
fml/install/fml.py
1810
fml/install/fml.py
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,15 @@
|
|||
import os, os.path, sys
|
||||
from optparse import OptionParser
|
||||
|
||||
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp
|
||||
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp, download_mcp
|
||||
|
||||
def fml_main(fml_dir, mcp_dir, dont_gen_conf=True, disable_patches=False, disable_at=False, disable_merge=False, enable_server=False,
|
||||
disable_client=False, disable_rename=False, disable_assets=False):
|
||||
def fml_main(fml_dir, mcp_dir, gen_conf=True, disable_patches=False, disable_at=False, disable_merge=False, enable_server=False,
|
||||
disable_client=False, disable_rename=False, disable_assets=False, decompile=False):
|
||||
print '================ Forge ModLoader Setup Start ==================='
|
||||
setup_mcp(fml_dir, mcp_dir, dont_gen_conf, download)
|
||||
setup_fml(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge,
|
||||
download_mcp(fml_dir, mcp_dir)
|
||||
setup_mcp(fml_dir, mcp_dir, gen_conf)
|
||||
if decompile:
|
||||
decompile_minecraft(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge,
|
||||
enable_server=enable_server, disable_client=disable_client,
|
||||
disable_assets=disable_assets)
|
||||
if disable_patches:
|
||||
|
@ -15,6 +17,8 @@ def fml_main(fml_dir, mcp_dir, dont_gen_conf=True, disable_patches=False, disabl
|
|||
else:
|
||||
apply_fml_patches(fml_dir, mcp_dir, os.path.join(mcp_dir, 'src'))
|
||||
finish_setup_fml(fml_dir, mcp_dir, enable_server=enable_server, disable_client=disable_client, disable_rename=disable_rename)
|
||||
else:
|
||||
print 'Decompile free install is on the to-do!'
|
||||
print '================ Forge ModLoader Setup End ==================='
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -27,6 +31,7 @@ if __name__ == '__main__':
|
|||
parser.add_option('-e', '--no-merge', action="store_true", dest='no_merge', help='Disable merging server code into client', default=False)
|
||||
parser.add_option('-n', '--no-rename', action="store_true", dest='no_rename', help='Disable running updatenames', default=False)
|
||||
parser.add_option('-a', '--no-assets', action="store_true", dest='no_assets', help='Disable downloading of assets folder', default=False)
|
||||
parser.add_option('-d', '--decompile', action="store_true", dest='decompile', help='Decompile minecraft and apply patches', default=True)
|
||||
options, _ = parser.parse_args()
|
||||
|
||||
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -46,4 +51,5 @@ if __name__ == '__main__':
|
|||
fml_main(fml_dir, mcp_dir, disable_patches=options.no_patch,
|
||||
disable_at=options.no_access, disable_merge=options.no_merge,
|
||||
enable_server=options.enable_server, disable_client=options.no_client,
|
||||
disable_rename=options.no_rename, disable_assets=options.assets)
|
||||
disable_rename=options.no_rename, disable_assets=options.assets,
|
||||
decompile=options.decompile, gen_conf=False)
|
94
fml/jsons/1.6-dev.json
Normal file
94
fml/jsons/1.6-dev.json
Normal file
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.client.main.Main"
|
||||
}
|
93
fml/jsons/1.6-rel.json
Normal file
93
fml/jsons/1.6-rel.json
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:{version}",
|
||||
"devdl" : "false"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.client.main.Main"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
[default]
|
||||
current_ver = 1.5.2
|
||||
current_ver = 1.6
|
||||
base_url = http://s3.amazonaws.com/MinecraftDownload/
|
||||
libraries = lwjgl.jar lwjgl_util.jar jinput.jar
|
||||
natives = windows_natives.jar macosx_natives.jar linux_natives.jar
|
||||
|
@ -94,9 +94,9 @@ mcp_ver = 7.51
|
|||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp751.zip
|
||||
mcp_md5 = a8c68db8736227c9e26cbcb0995e5b71
|
||||
|
||||
[13w24a]
|
||||
client_md5 = 6164313863f51af4f0ea206fc351dacf
|
||||
server_md5 = 25ae7388545ae5a533508b1983cce796
|
||||
[1.6]
|
||||
client_md5 = 6a64a2136e3a3fe4d29b0a0df30b25fc
|
||||
server_md5 = 7c03305c8bf97a8e8f3cdb147fc90607
|
||||
mcp_ver = 7.98
|
||||
mcp_url = NO_DOWNLOAD_YET
|
||||
mcp_md5 = a8c68db8736227c9e26cbcb0995e5b71
|
||||
mcp_url =
|
||||
mcp_md5 = e2ecc18dc6907dcb63bf5506f9d137d9
|
||||
|
|
|
@ -63,7 +63,7 @@ def main():
|
|||
|
||||
cleanDirs(patchd)
|
||||
|
||||
backup = os.path.join(mcp, 'runtime', 'commands.py.bck')
|
||||
backup = os.path.join(mcp, 'runtime', 'commands.py.backup')
|
||||
runtime = os.path.join(mcp, 'runtime', 'commands.py')
|
||||
patch_file = os.path.join(fml_dir, 'commands.patch')
|
||||
|
||||
|
|
Loading…
Reference in a new issue