MinimallyCorrect / ModPatcher

Allows easy patching of mods/plugins/arbitrary minecraft classes using config files
MIT License
8 stars 6 forks source link

Avoid running the same class through transformers twice #10

Closed LunNova closed 7 years ago

LunNova commented 8 years ago

Currently there's an edge-case which can cause transformers to run twice.

https://github.com/nallar/ModPatcher/blob/1.8.9/src/main/java/me/nallar/modpatcher/LaunchClassLoaderUtil.java#L129

LunNova commented 8 years ago

Looks like it'll be impossible to fix this without getting a change in LaunchClassLoader which isn't going to happen (it's mojang code...)

May be some hacky workaround possibilities with replacing the LaunchClassLoader with another which delegates to it.

LunNova commented 8 years ago

Partially resolved in e8bc0645a5eaee0fa.

Avoids running unknown (possibly stateful?) transformers repeatedly, we only re-use known safe forge transformers.

LunNova commented 8 years ago

Changed in 434f1ad367 to only include the forge patching and deobfuscation transformers. That's all that should be needed.

LunNova commented 7 years ago

Considered to be effectively fixed. If experiencing worse startup time due to ModPatcher consider using https://github.com/nallar/CachingClassLoader