mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-06-15 16:10:40 +00:00
Got Sponge support working, need to ensure other plugins are still working tho
This commit is contained in:
@@ -55,14 +55,20 @@ import java.util.jar.JarOutputStream;
|
||||
public final class LibraryLoader {
|
||||
|
||||
@SuppressWarnings("Guava")
|
||||
private static final Supplier<URLClassLoaderAccess> URL_INJECTOR = Suppliers.memoize(() ->
|
||||
URLClassLoaderAccess.create((URLClassLoader) AntiVPN.getInstance().getClass().getClassLoader()));
|
||||
private static final Supplier<URLClassLoaderAccess> URL_INJECTOR = AntiVPN.getInstance().getClass().getClassLoader() instanceof URLClassLoader ?
|
||||
Suppliers.memoize(() ->
|
||||
URLClassLoaderAccess.create((URLClassLoader) AntiVPN.getInstance().getClass().getClassLoader()))
|
||||
: null;
|
||||
|
||||
public static void loadAll(Object object) {
|
||||
if(URL_INJECTOR == null)
|
||||
return;
|
||||
loadAll(object.getClass());
|
||||
}
|
||||
|
||||
public static void loadAll(Class<?> clazz) {
|
||||
if(URL_INJECTOR == null)
|
||||
return;
|
||||
MavenLibrary[] libs = clazz.getDeclaredAnnotationsByType(MavenLibrary.class);
|
||||
|
||||
for (MavenLibrary lib : libs) {
|
||||
|
||||
Reference in New Issue
Block a user