Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

can't build baritone with litematica using the gradle `runClient` task

Redhawk18 opened this issue ยท 7 comments

commented

Some information

Operating system:
Java version: 17
Minecraft version: 1.19.4
Baritone version: 1.19.4 branch
Other mods (if used): litematica

How to reproduce

trigger the runClient task once to create all the files and then close and try to install Litematica.

I tried adding it to the mods folder and updating fabric which did not work. I also tried adding it to the build.gradle to see if that would work which it did not. Here's the exact branch and patchfile for what I was doing, good luck if you can get this to work.

https://github.com/Redhawk18/baritone/tree/map-art-builder-1.19
litematica-changes.patch.txt

commented

Ugh, shouldn't this "just work" with Baritone now using a standard setup... ?
If you add a normal Litematica build to the mods folder fabric has to remap it. I'd expect it to be able to do that, but I don't know.
If you add a normal Litematica build as a dependency you'll probably have to use a specific dependency type (modImplementation?) so unimined knows it has to remap it to workspace mappings.
Also if you add it as a dependency to the main buildscript you will run into problems because adding a fabric-only dependency to a fabric+forge+vanilla build doesn't work. It's probably the easiest if you add it as a runtime only dependency to the fabric buildscript and if you need more litematica API methods just add them to the existing stubs in src/schematica_api.
If you use a mojmapped Litematica build it doesn't need to be remapped, which might help. I mainly know that being done for Baritone itself on 1.12.2 because for some reason there were no srg mapped builds (releases used obf names and an mcp mapped jar was produced as a byproduct of normal builds).

commented

I've already tired the first two and failed how would I add it to the fabric runtime script?

commented

I tried getting it to work and gave up. Everything either crashes with fabric complaining about fabric-resource-loader access wideners using intermediary names when the environment uses named names or it crashes during malilib/litematica mixin application because it can't find the classes by their intermediary names (or the configuration I try doesn't exist at all. E.g. modRuntimeOnly seems to not be a thing).
Searching for documentation failed and I did not try manually remapping the mixins and also did not try building malilib/litematica with mojmap as target mappings since that does not make for a good solution anyways.

@wagyourtail maybe you can help here?

commented

Well. Looking at just the patch txt. modImplementation should be used instead of implementation.

As for modruntimeonly and such
i only provide modImplementation and the ability to create more with

configurations {
  modCompileOnly
  compileOnly.extendsFrom modCompileOnly
}

unimined.minecraft {
    mods {
        remap(configurations.modCompileOnly)
    }
}

this actually allows you to have configurations that remap mods from different source mappings to your target mappings, because you can config each configuration's remapper sperately

commented

Using modImplementation in fabric/build.gradle is one of the attempts that crashed during fabric:runClient because Mixin searched target classes by their intermediary names.
The same happened for (also in fabric/build.gradle)

configurations {
    modRuntimeOnly
    runtimeOnly.extendsFrom modRuntimeOnly
}

unimined.minecraft {
    mods {
        remap(configurations.modRuntimeOnly)
    }
}
commented

fabric loader is supposed to remap the mixins at runtime...

commented

if that's not happening, you can try the ahead of time remapping with

mods {
        remap(configurations.modRuntimeOnly) {
            mixinRemap {
                reset()
                enableBaseMixin()
                enableMixinExtra()
            }
        }
    }