Class Entrypoint

java.lang.Object
net.neoforged.fml.startup.Entrypoint
Direct Known Subclasses:
Client, DataClient, DataServer, GameTestServer, Server

public abstract class Entrypoint extends Object
Provides a convenient base-class for our entry point classes.
  • Constructor Details

    • Entrypoint

      protected Entrypoint()
  • Method Details

    • startup

      protected static Entrypoint.StartupResult startup(String[] args, boolean headless, net.neoforged.api.distmarker.Dist dist, boolean cleanDist)
    • listClasspathEntries

      private static List<File> listClasspathEntries()
    • getGameDir

      private static Path getGameDir(String[] args)
    • getArg

      private static String getArg(String[] args, String name, String defaultValue)
    • hasCustomLoggingConfiguration

      private static boolean hasCustomLoggingConfiguration()
      If a user (or launcher) supplies an explicit Log4j2 configuration file, it should be used over the one we ship with FML. We try to detect whether one is given using the usual Log4j2 configuration properties.

      See Log4j2 documentation.

    • overwriteLoggingConfiguration

      static void overwriteLoggingConfiguration()
      Forces the log4j2 logging context to use the configuration shipped with fml_loader.
    • createMainMethodCallable

      protected static MethodHandle createMainMethodCallable(Entrypoint.StartupResult startupResult, String mainClassName)
      The only point of this is to get a neater stacktrace in all crash reports, since this will replace three levels of Java reflection with one generated lambda method.
    • findThread

      @Nullable protected static @Nullable Thread findThread(String threadName)