Fabric API

Fabric API

112M Downloads

Datagen AccessWideners not working

moltenwolfcub opened this issue ยท 2 comments

commented

I'm going through the process of updating a fabric mod from 1.18.2 to 1.19 and the accessWideners in the fabric-data-generation-api-v1 don't seem to properly be widening all their methods.

accessWidenerFailure

Some examples:

  • The planksFromLogs method in net.minecraft.data.recipe.RecipeProvider has the comment saying "Access widened by fabric-data-generation-api-v1 to accessible" however the method remains private
  • The same thing happens with generateFlatItem in net.minecraft.data.models.ItemModelGenerators
  • All the datagenerator vanilla classes aren't getting properly access widened

As far as I have looked, the other fabric modules are access widening normally and this behaviour from the datagen seems to only affect methods (classes and fields still work).

My build.gradle may have been incorrectly set up after the update as I had a lot of trouble with it. This behaviour worked in the 1.18.2 version with fabric_version = 0.59.0+1.18.2 and loader_version=0.14.9

My relavent settings

//gradle.properties
minecraft_version=1.19
loader_version=0.14.14
fabric_version=0.58.0+1.19

//build.gradle
mappings loom.officialMojangMappings()

loom {
    runs {
        // This adds a new gradle task that runs the datagen API: "gradlew runDatagenClient"
        datagenClient {
            inherit client
            name "Data Generation"
            vmArg "-Dfabric-api.datagen"
            vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
            vmArg "-Dfabric-api.datagen.strict-validation"
 
            runDir "build/datagen"
        }
    }
	accessWidenerPath = file("src/main/resources/crafted_cuisine.accesswidener")
}

if any more info is required I can attach relavant files.
The github repo currently pre-1.19 still uncommited the transfer

Thanks in advance and I apologise if the problem is with the build setup on my end.

commented

Please try with loom 1.1, you can update this in the top of your build.gradle file.

commented

Thanks a lot. That fixed it. I should have thought to check that my build.gradle matched the fabric example project

All fixed now. :)