PatchworkMC / patchwork-patcher

Patches Forge mod jars, allowing them to be loaded by Fabric
GNU Lesser General Public License v3.0
315 stars 33 forks source link

"Mod jars are not allowed to contain classes in Minecraft's package!" error #74

Open Dycool opened 3 years ago

Dycool commented 3 years ago

Im getting this error and idk how to fix it. [20:28:25] [main/INFO] (Patchwork/UI) Welcome to Patchwork Patcher! [20:28:25] [main/INFO] (Patchwork/UI) Patchwork is still an early project, things might not work as expected! Let us know the issues on GitHub! [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) Checking whether intermediary for 1.14.4 exists... [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) Intermediary for 1.14.4 already exists, using downloaded data. [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) Checking whether MCPConfig for 1.14.4 exists... [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) MCPConfig for 1.14.4 already exists, using downloaded data. [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) Minecraft jar already exists for Minecraft 1.14.4. [20:28:28] [pool-2-thread-2/INFO] (Patchwork/UI) Preparation Complete!

[20:28:28] [pool-2-thread-2/INFO] (Patchwork) Remapping and patching MorePlayerModels_1.14.4-(24Jun20) (TinyRemapper, srg -> intermediary) [20:28:29] [pool-3-thread-7/WARN] (Patchwork) Unknown Forge field annotation: Lnet/minecraftforge/common/capabilities/CapabilityInject; [20:28:29] [pool-3-thread-7/WARN] (Patchwork) value -> Lnoppes/mpm/ModelData; [20:28:29] [pool-2-thread-2/ERROR] (Patchwork) Throwing java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Mod jars are not allowed to contain classes in Minecraft's package! at net.fabricmc.tinyremapper.TinyRemapper.waitForAll(TinyRemapper.java:758) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.fabricmc.tinyremapper.TinyRemapper.apply(TinyRemapper.java:623) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.Patchwork.remap(Patchwork.java:349) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.Patchwork.transformMod(Patchwork.java:196) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.Patchwork.patchAndFinish(Patchwork.java:116) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.PatchworkUI.startPatching(PatchworkUI.java:540) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.PatchworkUI.lambda$null$10(PatchworkUI.java:331) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.PatchworkUI.runWithNoExitCall(PatchworkUI.java:387) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.PatchworkUI.lambda$null$12(PatchworkUI.java:329) ~[patchwork-patcher-0.3.0.jar:0.3.0] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_261] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_261] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:1.8.0_261] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_261] at java.lang.Thread.run(Unknown Source) [?:1.8.0_261] Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Mod jars are not allowed to contain classes in Minecraft's package! at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_261] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_261] at net.fabricmc.tinyremapper.TinyRemapper.waitForAll(TinyRemapper.java:755) ~[patchwork-patcher-0.3.0.jar:0.3.0] ... 15 more Caused by: java.lang.IllegalArgumentException: Mod jars are not allowed to contain classes in Minecraft's package! at net.patchworkmc.patcher.transformer.PatchworkTransformer.accept(PatchworkTransformer.java:87) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.patchworkmc.patcher.transformer.PatchworkTransformer.accept(PatchworkTransformer.java:47) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.fabricmc.tinyremapper.TinyRemapper.lambda$apply$1(TinyRemapper.java:612) ~[patchwork-patcher-0.3.0.jar:0.3.0] at net.fabricmc.tinyremapper.TinyRemapper.lambda$apply$2(TinyRemapper.java:620) ~[patchwork-patcher-0.3.0.jar:0.3.0] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_261] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_261] ... 3 more [20:28:29] [pool-2-thread-2/INFO] (Patchwork/UI) Successfully patched 0 mod(s)!

Tfarcenim commented 3 years ago

Which mod is this?

Dycool commented 3 years ago

More player models. https://www.curseforge.com/minecraft/mc-mods/more-player-models

sylv256 commented 3 years ago

These lines look important:

[20:28:28] [pool-2-thread-2/INFO] (Patchwork) Remapping and patching MorePlayerModels_1.14.4-(24Jun20) (TinyRemapper, srg -> intermediary)
[20:28:29] [pool-3-thread-7/WARN] (Patchwork) Unknown Forge field annotation: Lnet/minecraftforge/common/capabilities/CapabilityInject;
[20:28:29] [pool-3-thread-7/WARN] (Patchwork) value -> Lnoppes/mpm/ModelData;
[20:28:29] [pool-2-thread-2/ERROR] (Patchwork) Throwing
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Mod jars are not allowed to contain classes in Minecraft's package!
at net.fabricmc.tinyremapper.TinyRemapper.waitForAll(TinyRemapper.java:758) ~[patchwork-patcher-0.3.0.jar:0.3.0]
ramidzkh commented 3 years ago

It's not OP's fault - the mod uses a questionable technique to do something. Since the mod isn't open source, I don't think you would be successful in convincing the authors to not do that

(The mod uses a package private bridge class instead of an access transformer)

ramidzkh commented 3 years ago

I added the bug label since maybe it's within patcher's scope to resolve this (to the best of it's ability) - I'll get back to you on this

TwilightFlower commented 3 years ago

Doesn't Forge encourage using awful package hacks over ATs?

TheGlitch76 commented 3 years ago

it does

Fox2Code commented 3 years ago

I think moving all packages that does not replace Minecraft classes to net.minecraft. should do the trick since Fabric rename all the minecraft classes with names like net.minecraft.class123 so this should resolve the access issue without having to guess access transformers needed for each mod

TheGlitch76 commented 3 years ago

That check also exists because of some assumptions coderbots event handler scanning code does (which I still don't understand), so this is still a large scale refactor to support. It's on the list but I'm not going to consider it a priority for 1.15.

sylv256 commented 3 years ago

It's not OP's fault - the mod uses a questionable technique to do something. Since the mod isn't open source, I don't think you would be successful in convincing the authors to not do that

(The mod uses a package private bridge class instead of an access transformer)

No, I know. I'm just trying to help solve it.