private static URL extractJar(ClassLoader loaderClassLoader, String jarResourcePath) throws LoadingException {
        // get the jar-in-jar resource
        URL jarInJar = loaderClassLoader.getResource(jarResourcePath);
        if (jarInJar == null) {
            throw new LoadingException("Could not locate jar-in-jar");
        }

        // create a temporary file
        // on posix systems by default this is only read/writable by the process owner
        Path path;
        try {
            path = Files.createTempFile("luckperms-jarinjar", ".jar.tmp");
        } catch (IOException e) {
            throw new LoadingException("Unable to create a temporary file", e);
        }

        // mark that the file should be deleted on exit
        path.toFile().deleteOnExit();

        // copy the jar-in-jar to the temporary file path
        try (InputStream in = jarInJar.openStream()) {
            Files.copy(in, path, StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException e) {
            throw new LoadingException("Unable to copy jar-in-jar to temporary path", e);
        }

        try {
            return path.toUri().toURL();
        } catch (MalformedURLException e) {
            throw new LoadingException("Unable to get URL from path", e);
        }
    }
Extracts the "jar-in-jar" from the loader plugin into a temporary file,
then returns a URL that can be used by the {@link JarInJarClassLoader}.

@param loaderClassLoader the classloader for the "host" loader plugin
@param jarResourcePath the inner jar resource path
@return a URL to the extracted file
common/loader-utils/src/main/java/me/lucko/luckperms/common/loader/JarInJarClassLoader.java