docs: private static <T> T loadAndInstantiateClassImpl(
              AddOnClassLoader addOnClassLoader,
              String classname,
              Class<T> clazz,
              String type) {
          Class<?> cls;
          try {
              cls = addOnClassLoader.loadClass(classname);
          } catch (ClassNotFoundException e) {
              LOGGER.error("Declared \"" + type + "\" was not found: " + classname, e);
              return null;
          } catch (LinkageError e) {
              LOGGER.error("Declared \"" + type + "\" could not be loaded: " + classname, e);
              return null;
          }
  
          if (Modifier.isAbstract(cls.getModifiers()) || Modifier.isInterface(cls.getModifiers())) {
              LOGGER.error("Declared \"" + type + "\" is abstract or an interface: " + classname);
              return null;
          }
  
          if (!clazz.isAssignableFrom(cls)) {
              LOGGER.error("Declared \"" + type + "\" is not of type \"" + clazz.getName() + "\": " + classname);
              return null;
          }
  
          try {
              @SuppressWarnings("unchecked")
              Constructor<T> c = (Constructor<T>) cls.getConstructor();
              return c.newInstance();
          } catch (LinkageError | Exception e) {
              LOGGER.error("Failed to initialise: " + classname, e);
          }
          return null;
      }