Issues with shipping Sponge Mixins
MarkL4YG opened this issue ยท 11 comments
Hey there,
I just wanted to make you aware of potential issues with shipping Sponges Mixins within your jar.
When using SpongeForge your version of Mixins is preferred over the version from the SpongeForge jar which may cause issues when the versions differ.
I would suggest adding a real dependency forcing servers not using Sponge to include the Mixins as library mod instead.
This however is of course your decision. I'm just trying to raise awareness.
Yes, I'm aware, but I don't want people downloading my mod having to also download another dependency.
I think ideally, Mixin should be able to find the best version available on the classpath.
(Public) Servers running your mods will almost certainly run Sponge. Therefore they'll potentially run into issues.
I don't think Mixins should be making checks for being in the classpath bypassing the normal classs loader behavior. I would really say making a server/client build may be a safer way without having explicit dependencies. (Or maybe a Sponge build of the core mod.)
As of 1.12.2-6.4.0, we can't use MalisisCore on a sponge server due to incompatible mixins version.
Same reason I stumbled across this.
Work-Around is:
Open Malisis core jar in your favourite zip editor and remove the mixins package. The JVM will then use the remaining Mixins implementation for Malisis' mixins.
(Do this only on your server if your client version does not ship sponge)
@MarkL4YG Do you have some thorough instructions? I tried removing it from malisis\core\asm but I get the following:
[09:06:03] [main/FATAL] [mixin]: Mixin prepare failed preparing MixinClientNotif$MixinWorld in mixins.malisiscore.core.json: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException java.lang.ClassNotFoundException: The specified mixin 'net.malisis.core.asm.mixin.core.MixinClientNotif$MixinWorld' was not found
org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: java.lang.ClassNotFoundException: The specified mixin 'net.malisis.core.asm.mixin.core.MixinClientNotif$MixinWorld' was not found
at org.spongepowered.asm.mixin.transformer.MixinInfo.<init>(MixinInfo.java:795) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinConfig.prepareMixins(MixinConfig.java:569) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinConfig.prepare(MixinConfig.java:502) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinTransformer.prepareConfigs(MixinTransformer.java:647) [spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinTransformer.select(MixinTransformer.java:572) [spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinTransformer.checkSelect(MixinTransformer.java:548) [spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:451) [spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) [spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) [launchwrapper-1.12.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [?:1.8.0_181]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [?:1.8.0_181]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_181]
at java.lang.Class.forName(Class.java:348) [?:1.8.0_181]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:62) [server.jar:?]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:31) [server.jar:?]
Caused by: java.lang.ClassNotFoundException: The specified mixin 'net.malisis.core.asm.mixin.core.MixinClientNotif$MixinWorld' was not found
at org.spongepowered.asm.mixin.transformer.MixinInfo.loadMixinClass(MixinInfo.java:1170) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
at org.spongepowered.asm.mixin.transformer.MixinInfo.<init>(MixinInfo.java:788) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
... 21 more
So I'm removing the mixing located in sponge and not in malisis? Isn't that a hasard? I would honestly rather remove malisis all together. There's probably a good reason why they're using a later version of mixins and I'd rather it not fall back on the old one.
That's because you did not remove Mixins ^^.
Mixins is located under org.spongepowered
. In my case Mixins was the only thing located under that package included in the Malisis-Core jar-file. So try just to remove that and you should be good to go for a Sponge server. If you want to use that same jar on the client, you'll have to install Mixins/Sponge.
Again. You are removing the Sponge package from the Malisis-Core jar file. So you are removing the version that is shipped with Malisis.
that package included in the Malisis-Core jar-file
I thought that this would suffice for that information at least for those regularly modding Minecraft.
But I'm sorry if that wasn't the case. I didn't mean to sound rude in any way.
Yes, it is the decision of the mod author whether or not to include the mods dependencies in the final jar file.
While it is not common or usual for Minecraft mods to do so, there's actually nothing really wrong about that. The author just has to be aware that while this circumvents the issue of clients having to install dependencies to use the mod on its own, it poses other error risks such as this where the dependency ends up in the JVM twice (or more) possibly with incompatible versions.
I personally would not favor this approach and rather have users install the dependency but I would not blame the author.
Mixins is located under org.spongepowered
Please try to be more specific in the future. You're going all over the place.
org.spongepowered
is the name of sponge's package. Honestly I blame the mod author since why the actual is he including this, but you're really not helping people who don't program java.