Record Class StartupArgs

java.lang.Object
java.lang.Record
net.neoforged.fml.startup.StartupArgs
Record Components:
gameDirectory -
headless -
dist - If set to null, the distribution being launched is auto-detected, otherwise it is set to this. In a dev-environment where a "joined" distribution is being used, this parameter also disables access to classes and resources of the inactive distribution, if cleanDist is also set.
cleanDist - If enabled, the loader will try to prevent loading Minecraft classes that do not belong to dist, but are otherwise present on the classpath (i.e. in joined distribution scenarios in development).
programArgs -
claimedFiles -
unclaimedClassPathEntries -
parentClassLoader -

public record StartupArgs(Path gameDirectory, boolean headless, @Nullable net.neoforged.api.distmarker.Dist dist, boolean cleanDist, String[] programArgs, Set<File> claimedFiles, List<File> unclaimedClassPathEntries, @Nullable ClassLoader parentClassLoader) extends Record
  • Field Details

    • gameDirectory

      private final Path gameDirectory
      The field for the gameDirectory record component.
    • headless

      private final boolean headless
      The field for the headless record component.
    • dist

      @Nullable private final @Nullable net.neoforged.api.distmarker.Dist dist
      The field for the dist record component.
    • cleanDist

      private final boolean cleanDist
      The field for the cleanDist record component.
    • programArgs

      private final String[] programArgs
      The field for the programArgs record component.
    • claimedFiles

      private final Set<File> claimedFiles
      The field for the claimedFiles record component.
    • unclaimedClassPathEntries

      private final List<File> unclaimedClassPathEntries
      The field for the unclaimedClassPathEntries record component.
    • parentClassLoader

      @Nullable private final @Nullable ClassLoader parentClassLoader
      The field for the parentClassLoader record component.
  • Constructor Details

    • StartupArgs

      public StartupArgs(Path gameDirectory, boolean headless, @Nullable @Nullable net.neoforged.api.distmarker.Dist dist, boolean cleanDist, String[] programArgs, Set<File> claimedFiles, List<File> unclaimedClassPathEntries, @Nullable @Nullable ClassLoader parentClassLoader)
      Creates an instance of a StartupArgs record class.
      Parameters:
      gameDirectory - the value for the gameDirectory record component
      headless - the value for the headless record component
      dist - the value for the dist record component
      cleanDist - the value for the cleanDist record component
      programArgs - the value for the programArgs record component
      claimedFiles - the value for the claimedFiles record component
      unclaimedClassPathEntries - the value for the unclaimedClassPathEntries record component
      parentClassLoader - the value for the parentClassLoader record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • gameDirectory

      public Path gameDirectory()
      Returns the value of the gameDirectory record component.
      Returns:
      the value of the gameDirectory record component
    • headless

      public boolean headless()
      Returns the value of the headless record component.
      Returns:
      the value of the headless record component
    • dist

      @Nullable public @Nullable net.neoforged.api.distmarker.Dist dist()
      Returns the value of the dist record component.
      Returns:
      the value of the dist record component
    • cleanDist

      public boolean cleanDist()
      Returns the value of the cleanDist record component.
      Returns:
      the value of the cleanDist record component
    • programArgs

      public String[] programArgs()
      Returns the value of the programArgs record component.
      Returns:
      the value of the programArgs record component
    • claimedFiles

      public Set<File> claimedFiles()
      Returns the value of the claimedFiles record component.
      Returns:
      the value of the claimedFiles record component
    • unclaimedClassPathEntries

      public List<File> unclaimedClassPathEntries()
      Returns the value of the unclaimedClassPathEntries record component.
      Returns:
      the value of the unclaimedClassPathEntries record component
    • parentClassLoader

      @Nullable public @Nullable ClassLoader parentClassLoader()
      Returns the value of the parentClassLoader record component.
      Returns:
      the value of the parentClassLoader record component