Option to disable renaming for srgnames.
This commit is contained in:
parent
ae58a0dbe3
commit
bd25e14545
2 changed files with 10 additions and 6 deletions
|
@ -429,13 +429,14 @@ def apply_fml_patches(fml_dir, mcp_dir, src_dir, copy_files=True):
|
||||||
if os.path.isdir(os.path.join(src_dir, 'minecraft', 'argo')):
|
if os.path.isdir(os.path.join(src_dir, 'minecraft', 'argo')):
|
||||||
shutil.rmtree(os.path.join(src_dir, 'minecraft', 'argo'))
|
shutil.rmtree(os.path.join(src_dir, 'minecraft', 'argo'))
|
||||||
|
|
||||||
def finish_setup_fml(fml_dir, mcp_dir, enable_server=False, disable_client=False):
|
def finish_setup_fml(fml_dir, mcp_dir, enable_server=False, disable_client=False, disable_rename=False):
|
||||||
sys.path.append(mcp_dir)
|
sys.path.append(mcp_dir)
|
||||||
from runtime.updatenames import updatenames
|
from runtime.updatenames import updatenames
|
||||||
from runtime.updatemd5 import updatemd5
|
from runtime.updatemd5 import updatemd5
|
||||||
from runtime.updatemcp import updatemcp
|
from runtime.updatemcp import updatemcp
|
||||||
|
|
||||||
os.chdir(mcp_dir)
|
os.chdir(mcp_dir)
|
||||||
|
if not disable_rename:
|
||||||
updatenames(None, True, not disable_client, enable_server)
|
updatenames(None, True, not disable_client, enable_server)
|
||||||
reset_logger()
|
reset_logger()
|
||||||
updatemd5(None, True, not disable_client, enable_server)
|
updatemd5(None, True, not disable_client, enable_server)
|
||||||
|
|
|
@ -3,7 +3,8 @@ 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
|
||||||
|
|
||||||
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):
|
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):
|
||||||
print '================ Forge ModLoader Setup Start ==================='
|
print '================ Forge ModLoader Setup Start ==================='
|
||||||
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
||||||
setup_fml(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge, enable_server=enable_server, disable_client=disable_client)
|
setup_fml(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge, enable_server=enable_server, disable_client=disable_client)
|
||||||
|
@ -11,7 +12,7 @@ def fml_main(fml_dir, mcp_dir, dont_gen_conf=True, disable_patches=False, disabl
|
||||||
print 'Patching disabled'
|
print 'Patching disabled'
|
||||||
else:
|
else:
|
||||||
apply_fml_patches(fml_dir, mcp_dir, os.path.join(mcp_dir, 'src'))
|
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)
|
finish_setup_fml(fml_dir, mcp_dir, enable_server=enable_server, disable_client=disable_client, disable_rename=disable_rename)
|
||||||
print '================ Forge ModLoader Setup End ==================='
|
print '================ Forge ModLoader Setup End ==================='
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -22,6 +23,7 @@ if __name__ == '__main__':
|
||||||
parser.add_option('-s', '--server', action="store_true", dest='enable_server', help='Enable decompilation of server', default=False)
|
parser.add_option('-s', '--server', action="store_true", dest='enable_server', help='Enable decompilation of server', default=False)
|
||||||
parser.add_option('-c', '--no-client', action="store_true", dest='no_client', help='Disable decompilation of server', default=False)
|
parser.add_option('-c', '--no-client', action="store_true", dest='no_client', help='Disable decompilation of server', default=False)
|
||||||
parser.add_option('-e', '--no-merge', action="store_true", dest='no_merge', help='Disable merging server code into client', default=False)
|
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)
|
||||||
options, _ = parser.parse_args()
|
options, _ = parser.parse_args()
|
||||||
|
|
||||||
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
@ -40,4 +42,5 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
fml_main(fml_dir, mcp_dir, disable_patches=options.no_patch,
|
fml_main(fml_dir, mcp_dir, disable_patches=options.no_patch,
|
||||||
disable_at=options.no_access, disable_merge=options.no_merge,
|
disable_at=options.no_access, disable_merge=options.no_merge,
|
||||||
enable_server=options.enable_server, disable_client=options.no_client)
|
enable_server=options.enable_server, disable_client=options.no_client,
|
||||||
|
disable_rename=options.no_rename)
|
Loading…
Reference in a new issue