MoreMcmeta/core

Crash while in forge gradle enviroment

farinc opened this issue · 4 comments

farinc commented

Describe the bug
Attempting to any .moremcmeta for any animated texture results in a crash at runtime.

To reproduce
Steps to reproduce the behavior:

  1. Create a standard forge project with MoreMcmeta, using the recommended maven dependency. Used MoreMcmeta v1.18.2-4.2.3. I added those lines to the run options for correct remapping:
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
  1. Create a basic item or whatever to display an animated texture.
  2. Create a bare minimum .moremcmeta corresponding to the animated texture.
{
  "animation": {}
}
  1. Run client

Expected behavior
The game loads fine with the texture animated

Which Minecraft versions does this bug affect?
1.18.2. Have not tried higher versions

Mod loader
Which mod loaders does this bug affect?

  • Forge
  • Fabric

Mods list
My mod depends on the following excluding MoreMcmeta

  • Silent Gear
  • Silent Lib
  • Twilight Forest

Resource pack
None

Additional context
When no .moremcmeta is included in my mod assets, the game launches fine with all mods (including moremcmeta) and loading a world results in no crash.
For more detail regarding project setup (build.gradle, etc), here is my project.
Finally here is the crash report. The report seems to indicate that the .moremcmeta files are somehow problematic, but as I cannot see the json parsing code, I am having a hard time understanding how this is crashing. I am assuming this doesn't happen normally?

soir20 commented

It looks like this is a remapping issue in your dev environment.

java.lang.NoSuchMethodError: 'java.lang.String net.minecraft.resources.ResourceLocation.m_135827_()'

If everything was remapped correctly, I don't think this would be printing an obfuscated name. The JSON parser stacktrace is misleading; that's just where the first non-remapped method happened to be called. (If you are curious, the JSON parser code is in a separate repository here; MoreMcmeta is split into the core API and default plugins.)

I'm not super familiar with Forge Gradle since I've set up most of my projects with Architectury. I'll have to dig into your Gradle setup to pinpoint what the exact issue is, but looking at your remapping config is a good place to start.

soir20 commented

On second thought, maybe the issue is that Forge isn't remapping the default plugins. These are included as jar-in-jars. That would explain why MoreMcmeta isn't crashing immediately and why it crashes inside the JSON plugin.

I'm not sure how you tell Forge Gradle to deobf jar-in-jars off the top of my head.

soir20 commented

Here's a list of plugins that I believe you need to tell Forge Gradle to deobfuscate.

farinc commented

Ah bingo that was it, adding the plugin list as dependencies with fg.deobf was indeed the solution. I was wondering why the function name was obfuscated! Thanks a lot for the help and quick reply, got my animated texture just fine!