@Nullable
	private PluginException unload(@Nonnull LoadedPlugin plugin, @Nonnull Map<LoadedPlugin, Set<LoadedPlugin>> dependants) {
		String id = plugin.getContainer().info().id();
		if (!plugins.remove(id, plugin)) {
			throw new IllegalStateException("Plugin %s was already removed, recursion?".formatted(id));
		}
		PluginException exception = null;
		for (LoadedPlugin dependant : dependants.get(plugin)) {
			PluginException inner = unload(dependant, dependants);
			if (inner != null) {
				if (exception == null) {
					exception = inner;
				} else {
					exception.addSuppressed(inner);
				}
			}
		}
		try {
			PluginContainerImpl<?> container = plugin.getContainer();
			try {
				container.plugin().onDisable();
			} finally {
				if (container.classLoader instanceof AutoCloseable ac) {
					ac.close();
				}
			}
		} catch (Exception ex) {
			PluginException pex = new PluginException(ex);
			if (exception == null) {
				exception = pex;
			} else {
				exception.addSuppressed(pex);
			}
		}
		return exception;
	}
Attempts to unload the given plugin, along with its dependants.

@param plugin
		Plugin to unload.
@param dependants
		Map of plugin dependents.

@return Exception to be thrown if the plugin could not be unloaded.
recaf-core/src/main/java/software/coley/recaf/services/plugin/PluginGraph.java