Package net.minheur.potoflux
Class PotoFlux
java.lang.Object
net.minheur.potoflux.PotoFlux
Main class for PotoFlux. This should be set as mainClass in Gradle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic PotoScreenThe actual app.
This contains the JFrame and will be instantiated when the app will run.static final StringThe ID for potoflux (namespace) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLocationPotoFlux's reserved method to get aResourceLocationdirectly with PotoFlux's modId.static PathGetter for the mod common folder in the appData folder.
Mods should use this to resolve their modIds: this will be their own appData folderstatic PathGetter for the main program AppData folder.static StringGetter for the app's version.
If unable to get the version, return null.static voidThe 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 voidrunProgramClosing(int exitCode) This method should be used to close the app.
-
Field Details
-
ID
The ID for potoflux (namespace)- See Also:
-
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
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
Getter for the main program AppData folder.- Returns:
- the program's appData folder
-
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
Getter for the app's version.
If unable to get the version, return null.- Returns:
- the app version
-
fromModId
PotoFlux's reserved method to get aResourceLocationdirectly with PotoFlux's modId.- Parameters:
loc- the loc to add to the modId- Returns:
- a built
ResourceLocationwith potoflux's modId and the loc given
-