RetroMCP-Java icon indicating copy to clipboard operation
RetroMCP-Java copied to clipboard

Decompile task fails

Open counter185 opened this issue 3 years ago • 4 comments

Running the Decompile task on the latest commit fails on every game version, here's the stack trace: (I shortened this to not make this post longer than it needs to be)

java.nio.file.NoSuchFileException: conf\mappings.tiny
        ...
        at org.mcphackers.rdi.injector.data.Mappings.read(Mappings.java:33)
        at org.mcphackers.mcp.tasks.TaskDecompile.getMappings(TaskDecompile.java:136)
        at org.mcphackers.mcp.tasks.TaskDecompile.lambda$setStages$1(TaskDecompile.java:82)
        at org.mcphackers.mcp.tasks.TaskStaged$Stage.doTask(TaskStaged.java:70)
        ...
java.lang.RuntimeException: Failed to save class
        at org.mcphackers.mcp.tools.fernflower.DirectoryResultSaver.saveClassEntry(DirectoryResultSaver.java:34)
        at de.fernflower.struct.ContextUnit.save(ContextUnit.java:154)
        at de.fernflower.struct.StructContext.saveContext(StructContext.java:72)
        at de.fernflower.main.Fernflower.decompileContext(Fernflower.java:56)
        at de.fernflower.main.decompiler.BaseDecompiler.decompileContext(BaseDecompiler.java:46)
        at org.mcphackers.mcp.tools.fernflower.Decompiler.decompile(Decompiler.java:41)
        at org.mcphackers.mcp.tasks.TaskDecompile.lambda$setStages$2(TaskDecompile.java:107)
        ...
Caused by: java.nio.file.NoSuchFileException: temp\client\src\net\minecraft\src\a.java
        ...
        at org.mcphackers.mcp.tools.fernflower.DirectoryResultSaver.saveClassEntry(DirectoryResultSaver.java:29)
        ... 14 more

From what I can see here, it's trying to find the mappings.tiny file, which it can't. The stack trace refers to this line: https://github.com/MCPHackers/RetroMCP-Java/blob/4b2137010c0a732b4cbe0b6e4ae7bf7b64f9e0af/src/main/java/org/mcphackers/mcp/tasks/TaskDecompile.java#L136 which is trying to get the MCPPaths.MAPPINGS path, which is hardcoded to be conf/mappings.tiny. This file doesn't exist, instead, the mappings are split into client.tiny and server.tiny.

Replacing this line with

Mappings mappings = Mappings.read(MCPPaths.get(mcp, MCPPaths.CONF + "/" + side.name + ".tiny"), side.name, "named");

so that it reads the correct files, gives this stack trace instead:

java.lang.RuntimeException: Failed to save class
        at org.mcphackers.mcp.tools.fernflower.DirectoryResultSaver.saveClassEntry(DirectoryResultSaver.java:34)
        at de.fernflower.struct.ContextUnit.save(ContextUnit.java:154)
        at de.fernflower.struct.StructContext.saveContext(StructContext.java:72)
        at de.fernflower.main.Fernflower.decompileContext(Fernflower.java:56)
        at de.fernflower.main.decompiler.BaseDecompiler.decompileContext(BaseDecompiler.java:46)
        at org.mcphackers.mcp.tools.fernflower.Decompiler.decompile(Decompiler.java:41)
        at org.mcphackers.mcp.tasks.TaskDecompile.lambda$setStages$2(TaskDecompile.java:107)
        ...
Caused by: java.nio.file.NoSuchFileException: temp\client\src\net\minecraft\src\a.java
        ...
        at org.mcphackers.mcp.tools.fernflower.DirectoryResultSaver.saveClassEntry(DirectoryResultSaver.java:29)
        ... 14 more

counter185 avatar Jul 31 '22 07:07 counter185

i was having the same error to fix it just download the precompiled jar from https://github.com/MCPHackers/RetroMCP-Java/releases/tag/v1.0-pre1

brudder404 avatar Aug 03 '22 21:08 brudder404

The latest commits are very unstable and are in preparation for mappings merge (not codebase merge) and extra fun utils. If you are a developer wanting to mod MC, by all means, use v1.0-pre1 instead.

PhoenixVX avatar Aug 03 '22 22:08 PhoenixVX

just want to ask, do you have any ETA on when the source-compiled version will work again? the 1.0-pre1 release throws an error when setting the bootstrap class path and doesn't let you set the source and target versions to "1.7", and I kind of need that to make my mod support Java 7

counter185 avatar Aug 09 '22 09:08 counter185

Really, it's whenever we get RMCP v1.0 to a point where we can reasonably break backwards compatibility for new and enhanced features.

PhoenixVX avatar Aug 09 '22 09:08 PhoenixVX

I have this issue as well.

EGAMatsu avatar Dec 09 '22 00:12 EGAMatsu

Again, the latest commits are for developers of RMCP itself. Use the releases tab if you want to mod with RMCP.

PhoenixVX avatar Dec 09 '22 11:12 PhoenixVX

Development commits are now once again usable without the need for setting up a local version folder. Closing this issue since it was invalid in the first place and now the issue with it is fixed.

Look forward to fully functional user builds in the future and proper usage of a dev branch to ensure this doesn't happen again.

PhoenixVX avatar Jan 15 '23 02:01 PhoenixVX