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
|
@Override
|
||||||
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
|
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
|
||||||
log("launched from tweaker");
|
ClassLoader originalCtxCl = Thread.currentThread().getContextClassLoader();
|
||||||
bootstrap(transformers::add);
|
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
|
||||||
launchClassLoader.registerTransformer(TweakerTransformerAdapter.class.getName());
|
try {
|
||||||
|
log("launched from tweaker");
|
||||||
|
bootstrap(transformers::add);
|
||||||
|
launchClassLoader.registerTransformer(TweakerTransformerAdapter.class.getName());
|
||||||
|
} finally {
|
||||||
|
Thread.currentThread().setContextClassLoader(originalCtxCl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue