Class PotoFlux

java.lang.Object
net.minheur.potoflux.PotoFlux

public class PotoFlux extends Object
Main class for PotoFlux. This should be set as mainClass in Gradle.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static PotoScreen
    The actual app.
    This contains the JFrame and will be instantiated when the app will run.
    static final String
    The ID for potoflux (namespace)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    PotoFlux's reserved method to get a ResourceLocation directly with PotoFlux's modId.
    static Path
    Getter for the mod common folder in the appData folder.
    Mods should use this to resolve their modIds: this will be their own appData folder
    static Path
    Getter for the main program AppData folder.
    static String
    Getter for the app's version.
    If unable to get the version, return null.
    static void
    main(String[] args)
    The main method, that runs PotoFlux.
    It will first check for args, then enable devEnv if args contains it.
    We then get version and log it, load all optionalFeatures, set the theme and set the loaded translations.
    We get the loading bus, register all into it then list and load mods.
    We post all events to the bus, and invoke the app.
    static void
    runProgramClosing(int exitCode)
    This method should be used to close the app.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ID

      public static final String ID
      The ID for potoflux (namespace)
      See Also:
    • app

      public static PotoScreen app
      The actual app.
      This contains the JFrame and will be instantiated when the app will run.
  • Constructor Details

    • PotoFlux

      public PotoFlux()
  • Method Details

    • main

      public static void main(String[] args)
      The main method, that runs PotoFlux.
      It will first check for args, then enable devEnv if args contains it.
      We then get version and log it, load all optionalFeatures, set the theme and set the loaded translations.
      We get the loading bus, register all into it then list and load mods.
      We post all events to the bus, and invoke the app.
      Parameters:
      args - what you give to the app. Can contain 'devEnv' to enable PotoFlux's dev mod
    • getProgramDir

      public static Path getProgramDir()
      Getter for the main program AppData folder.
      Returns:
      the program's appData folder
    • getModDataDir

      public static Path getModDataDir()
      Getter for the mod common folder in the appData folder.
      Mods should use this to resolve their modIds: this will be their own appData folder
      Returns:
      the shared appData folder for mods
    • runProgramClosing

      public static void runProgramClosing(int exitCode)
      This method should be used to close the app. This allows the app to run extra saving code before exiting.
      Parameters:
      exitCode - the code given on closing.
    • getVersion

      public static String getVersion()
      Getter for the app's version.
      If unable to get the version, return null.
      Returns:
      the app version
    • fromModId

      public static ResourceLocation fromModId(String loc)
      PotoFlux's reserved method to get a ResourceLocation directly with PotoFlux's modId.
      Parameters:
      loc - the loc to add to the modId
      Returns:
      a built ResourceLocation with potoflux's modId and the loc given