Package org.lazywizard.lazylib
Class LazyLib
Object
BaseModPlugin
LazyLib
- All Implemented Interfaces:
ModPlugin
Contains information on the current version of LazyLib.
- Since:
- 1.1
- Author:
- LazyWizard
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getInfo()
Gets the library information (for startup messages, etc).static Level
Returns the log level used for all other LazyLib classes.static String
Returns the Starsector release this version was coded for.static float
Returns the running version of LazyLib.static boolean
Checks if caching of the results of expensive methods is enabled.void
static void
Called internally by LazyLib when a deprecated method is used.static void
setLogLevel
(Level level) Sets the log level used for all other LazyLib classes.Methods inherited from class BaseModPlugin
afterGameSave, beforeGameSave, configureXStream, onAboutToLinkCodexEntries, onAboutToStartGeneratingCodex, onCodexDataGenerated, onDevModeF8Reload, onEnabled, onGameLoad, onGameSaveFailed, onNewGame, onNewGameAfterEconomyLoad, onNewGameAfterProcGen, onNewGameAfterTimePass, pickDroneAI, pickMissileAI, pickShipAI, pickWeaponAutofireAI
-
Field Details
-
MOD_ID
- See Also:
-
-
Constructor Details
-
LazyLib
public LazyLib()
-
-
Method Details
-
getVersion
public static float getVersion()Returns the running version of LazyLib. If your mod requires features from a certain version of LazyLib, this can be used to warn players that their version is out of date.- Returns:
- The current version of LazyLib, as a
Float
. - Since:
- 1.1
-
getSupportedGameVersion
Returns the Starsector release this version was coded for.- Returns:
- The version of Starsector this library supports, as a
String
. - Since:
- 1.2
-
isCachingEnabled
public static boolean isCachingEnabled()Checks if caching of the results of expensive methods is enabled.- Returns:
true
if results caching is enabled,false
otherwise.- Since:
- 1.8b
-
getInfo
Gets the library information (for startup messages, etc).- Returns:
- A
String
containing information on the library. - Since:
- 1.2
-
getLogLevel
public static Level getLogLevel()Returns the log level used for all other LazyLib classes.LazyLib
itself will always use log levelLevel.ALL
.- Returns:
- The current log level for all LazyLib classes.
- Since:
- 1.6b
-
setLogLevel
public static void setLogLevel(Level level) Sets the log level used for all other LazyLib classes.- Parameters:
level
- The minimum level of entries that will be logged.- Since:
- 1.6
-
onDeprecatedMethodUsage
public static void onDeprecatedMethodUsage()Called internally by LazyLib when a deprecated method is used. If "logDeprecated" is set in lazylib_settings.json it will log usage of those methods. If "crashOnDeprecated" is true, this method will throw aRuntimeException
so modders can track down the problematic code using the stacktrace. You can ignore this method; there's no reason to ever call it manually, and calls from outside of LazyLib's namespace will be ignored.- Since:
- 1.7
-
onApplicationLoad
- Specified by:
onApplicationLoad
in interfaceModPlugin
- Overrides:
onApplicationLoad
in classBaseModPlugin
- Throws:
Exception
-