hube12 / DecompilerMC

This repository allows you to decompile any minecraft version that was published after 19w36a without any 3rd party mappings, you just need to execute the script or the executable (see releases)! Thanks mojang to have published proguard mappings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python stack trace when I run DecompilerMC with an older Minecraft version without client-mappings

pavog opened this issue · comments

Hi, when I try to run DecompilerMC with an older version of Minecraft that does not support client-mappings, I get an error message. See this example:

I run: python3 main.py --mcversion 1.14
and get this output:

Decompiling using official mojang mappings (Default option are in uppercase, you can just enter)
Manifest already existing, not downloading again, if you want to please accept safe removal at beginning
Version manifest already existing, not downloading again, if you want to please accept safe removal at beginning
Found 1.14.json
Traceback (most recent call last):
  File "/DecompilerMC/main.py", line 736, in <module>
    main()
  File "/DecompilerMC/main.py", line 663, in main
    get_mappings(version, side, args.quiet)
  File "/DecompilerMC/main.py", line 269, in get_mappings
    if url['client_mappings']:
KeyError: 'client_mappings'

I checked the code (main.py ~ line 269). I suggest to change this:

            if side == CLIENT:  # client:
                if url['client_mappings']:
                    url = url['client_mappings']['url']

to this:

            if side == CLIENT:  # client:
                if 'client_mappings' in url:
                    url = url['client_mappings']['url']

btw I use Python 3.10.9

commented

There is a bit more to it than just that