Can you please write the Mixins needed to get a resourcepack that is generated at…
- User
Can you please write the Mixins needed to get a resourcepack that is generated at runtime for Minecraft Fabric to work? It would need to be able to read existing resources and apply dynamically generated files based on them without causing a resource refresh - the code to generate the new resources is held somewhere of your choosing as a java Function instance, taking some sort of reference needed that can read the resources and returns something to add. I already have the code to generate the new files, but do not know what to pass in nor return from this Function, nor do I know where to start to get it working; my last attempt did not work as the resources were not available to load, and so I could not generate anything. Please do not replace any vanilla references, including via reflection, as a precautionary compatibility measure for any other mods wanting to do the same thing.
- Assistant
- User
oh - and which version of Minecraft Fabric did you write your code for?
- Assistant
The code provided in my previous answer is written for Minecraft Fabric 1.16.5. However, the concepts and general approach should be applicable to other versions of Minecraft Fabric as well. Please note that there might be some differences and updates required if you are working with a different version of Minecraft or Fabric, as the Fabric API and mixin methodology can change between versions.
- User
you said I would need to define the return type of the Function based on my implementation. Can I return any? Or is there something of a specific type/subtype I would need to return. And what can I use as an input that would satisfy my requirements?
- Assistant
- User
Again, what input type would meet my requirements that is available at this point in the resource loading?
- Assistant
Apologies for the confusion. At the point of resource loading in Minecraft Fabric, there isn't a direct input type available that provides access to the existing resources.
A potential approach to meet your requirements would be to leverage the itself as the input argument to the . This way, you can access the existing resources through the and generate new files based on them.