MCTeamPotato / Redirector

https://legacy.curseforge.com/minecraft/mc-mods/redirectionor
GNU Lesser General Public License v3.0
25 stars 7 forks source link

[Fabric] Change to ClassFileTransformer implementation #6

Open Kasualix opened 8 months ago

Kasualix commented 8 months ago

Mixins are way less effective/compatible than ClassFileTransformer for Redirector.

Currently investigate how to register the transformer

https://github.com/MCTeamPotato/Redirector/blob/modern-fabric/src/main/java/com/teampotato/redirector/RedirectorTransformer.java

Ecdcaeb commented 7 months ago

Fabric use launchwrapper, so use ITweak

Kasualix commented 7 months ago

https://github.com/FabricMC/fabric-loader/blob/master/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/launchwrapper/FabricClassTransformer.java I was referring to this class earlier.

So if we create a transformer impl ITweaker like FabricTweaker, how can we register it and get it loaded into mc somewhere?

Ecdcaeb commented 7 months ago

use Launch.classLoader.registerTransformer in some early stage. ITweak is a early stage, but not the only one. You could ask fabric for help. Find out how to create a coremod. I am concerned that coremods are not supported, since fabric is built in mixin.(x