Package ovh.mythmc.gestalt.loader
Class PaperGestaltLoader
java.lang.Object
ovh.mythmc.gestalt.loader.GestaltLoader
ovh.mythmc.gestalt.loader.PaperGestaltLoader
A
GestaltLoader implementation for the Paper platform.
In addition to loading and enabling the Gestalt plugin JAR, this loader merges the
Gestalt plugin's class loader into the initializer plugin's class loader group using
PaperPluginClassLoaderUtil.mergeClassLoaders(Plugin, Plugin), allowing the
initializer to access Gestalt's classes directly.
Use builder() to construct an instance:
PaperGestaltLoader loader = PaperGestaltLoader.builder()
.initializer(this)
.build();
loader.initialize();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a newPaperGestaltLoader.PaperGestaltLoaderBuilder.Returns the root data directory of the plugin.org.bukkit.plugin.PluginReturns the plugin that initiated the Gestalt load.Returns the logger wrapper used to emit status messages during loading.protected booleanReturns whether Gestalt is already available and loaded on this platform.protected voidload()Performs the platform-specific routine to load the Gestalt JAR into the server.Methods inherited from class ovh.mythmc.gestalt.loader.GestaltLoader
getGestaltPath, getJarPath, initialize, terminate
-
Method Details
-
getInitializer
public org.bukkit.plugin.Plugin getInitializer()Returns the plugin that initiated the Gestalt load. Used for class loader merging.- Returns:
- the initializer plugin
-
getDataDirectory
Description copied from class:GestaltLoaderReturns the root data directory of the plugin. The Gestalt JAR will be placed at<dataDirectory>/libs/gestalt.jar.- Specified by:
getDataDirectoryin classGestaltLoader- Returns:
- the plugin data directory
-
getLogger
Description copied from class:GestaltLoaderReturns the logger wrapper used to emit status messages during loading.- Specified by:
getLoggerin classGestaltLoader- Returns:
- the logger wrapper
-
load
protected void load()Description copied from class:GestaltLoaderPerforms the platform-specific routine to load the Gestalt JAR into the server. Called byGestaltLoader.initialize()after the JAR has been verified to exist on disk.- Specified by:
loadin classGestaltLoader
-
isAvailable
protected boolean isAvailable()Description copied from class:GestaltLoaderReturns whether Gestalt is already available and loaded on this platform.If
true,GestaltLoader.initialize()will return early without downloading or loading.- Specified by:
isAvailablein classGestaltLoader- Returns:
trueif Gestalt is already loaded
-
builder
Returns a newPaperGestaltLoader.PaperGestaltLoaderBuilder.- Returns:
- a new builder
-