Class EarlyPluginLoader

java.lang.Object
com.hypixel.hytale.plugin.early.EarlyPluginLoader

public final class EarlyPluginLoader extends Object
Loads early plugins (class transformers) from the earlyplugins/ directory before HytaleServer is constructed. Uses Java's standard ServiceLoader mechanism for discovery.
  • Field Details

    • EARLY_PLUGINS_PATH

      @Nonnull public static final Path EARLY_PLUGINS_PATH
      A path to the default early plugins directory.
  • Method Details

    • loadEarlyPlugins

      public static void loadEarlyPlugins(@Nonnull String[] args)
      Loads all class transformers from the earlyplugins/ directory. This should be called in Main.main() before HytaleServer is constructed.

      Manually parses args to avoid loading Options class before TransformingClassLoader.

      Parameters:
      args - command line arguments (to check for --early-plugins, --singleplayer, --accept-early-plugins)
    • hasTransformers

      public static boolean hasTransformers()
      Returns:
      true if any transformers were loaded, false otherwise.
    • getTransformers

      public static List<ClassTransformer> getTransformers()
      Returns:
      a list of loaded ClassTransformer instances, sorted by priority. (highest first)
    • getPluginClassLoader

      @Nullable public static URLClassLoader getPluginClassLoader()
      Returns:
      the classloader used to load early plugin JARs, or null if no plugins were found.