quilt-loader icon indicating copy to clipboard operation
quilt-loader copied to clipboard

Issue regarding compatibility with Fabric (missing Fabric class)

Open Xujiayao opened this issue 1 year ago • 5 comments

Hi!

I have a new issue with my Fabric mod by a Quilt user (Please refer to Xujiayao/MCDiscordChat#62).

It seems that the problem occurs because my mod uses the following class:

net.fabricmc.loader.impl.metadata.EntrypointMetadata net.fabricmc.loader.impl.metadata.LoaderModMetadata

I looked at Quilt's source code (https://github.com/QuiltMC/quilt-loader/tree/develop/src/fabric/impl/java/net/fabricmc/loader/impl/metadata) and didn't seem to find this class either.

Quilt is compatible with the vast majority of Fabric mods. Is there any way to achieve compatibility with Quilt and Fabric at the same time?

Thank you very much!

Xujiayao avatar Jul 05 '22 04:07 Xujiayao

impl would generally mean "don't touch this or it may break at any time" (it's not part of the API which with loader always has api in the package name) I'm seeing that you're using that at https://github.com/Xujiayao/MCDiscordChat/blob/a44aecf4e928296a7156fc5f2675ae3d0f3ec5ad/src/main/java/top/xujiayao/mcdiscordchat/minecraft/mixins/MixinLanguage.java. And honestly... that looks quite wrong on a quick look. Why do you need that, and are you sure you need that?

Let's assume you do... there's a public API that achieves what you're doing: https://maven.fabricmc.net/docs/fabric-loader-0.14.8/net/fabricmc/loader/api/ModContainer.html#findPath(java.lang.String)

kb-1000 avatar Jul 05 '22 16:07 kb-1000

While kb-1000 is correct I think we can probably re-expose those fabric metadata legacy interfaces anyway, in the same way that we currently expose other legacy interfaces.

AlexIIL avatar Jul 05 '22 16:07 AlexIIL

Why do you need that, and are you sure you need that?

Just to answer the question: This code is to fix Xujiayao/MCDiscordChat#35. It might not look good, but it does the trick.


I just fixed the deprecation problem of not using impl classes by https://github.com/Xujiayao/MCDiscordChat/commit/d1fd07a84403bf73f9a892f7f20cd680b3dc66d5. It works perfectly with Fabric but the latest commit 2c0d6591c606af6236c03e69020284f1288c38fc does not seem to fix the issue with Quilt.

Here is the log with Quilt Loader 0.17.1-beta.6: latest.log


Let's assume you do... there's a public API that achieves what you're doing: maven.fabricmc.net/docs/fabric-loader-0.14.8/net/fabricmc/loader/api/ModContainer.html#findPath(java.lang.String)

Thanks for the advice, I'll look into it.

Xujiayao avatar Jul 06 '22 04:07 Xujiayao

https://github.com/Xujiayao/MCDiscordChat/commit/b4a322419c3f99fc27eab7ad5d84b37d1d1b6b8f Rewriting it to findPath fix the issue with Quilt.

This issue can be closed if compatibility with those classes is not so important. I will leave the decision to you, thx!

Xujiayao avatar Jul 06 '22 05:07 Xujiayao

That actually sounds like something resource loader should be doing, surprised it doesn't FML did that even back in 1.7

kb-1000 avatar Jul 06 '22 19:07 kb-1000

That actually sounds like something resource loader should be doing, surprised it doesn't FML did that even back in 1.7

According to my latest tests, the latest version of Fabric translates custom advancements. 👍

Xujiayao avatar Dec 10 '22 06:12 Xujiayao