mirror of
https://github.com/yushijinhun/authlib-injector.git
synced 2024-11-15 06:11:09 +01:00
fix ctx classloader
This commit is contained in:
parent
50159626ae
commit
feab9141c3
1 changed files with 9 additions and 3 deletions
|
@ -18,9 +18,15 @@ public class AuthlibInjectorTweaker implements ITweaker {
|
|||
|
||||
@Override
|
||||
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
|
||||
log("launched from tweaker");
|
||||
bootstrap(transformers::add);
|
||||
launchClassLoader.registerTransformer(TweakerTransformerAdapter.class.getName());
|
||||
ClassLoader originalCtxCl = Thread.currentThread().getContextClassLoader();
|
||||
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
|
||||
try {
|
||||
log("launched from tweaker");
|
||||
bootstrap(transformers::add);
|
||||
launchClassLoader.registerTransformer(TweakerTransformerAdapter.class.getName());
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(originalCtxCl);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue