Class UltiToolsBootstrap
- All Implemented Interfaces:
io.papermc.paper.plugin.bootstrap.PluginBootstrap
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbootstrap(io.papermc.paper.plugin.bootstrap.BootstrapContext context) (package private) voidchannelInstaller(io.papermc.paper.plugin.bootstrap.BootstrapContext context, ContributionRegistry contributions, Logger logger) (package private) URL[]classPath(ModuleFileTransactions transactions, File dataFolder, @Nullable URL serverJar, ModuleJarAdmission admission) org.bukkit.plugin.java.JavaPlugincreatePlugin(io.papermc.paper.plugin.bootstrap.PluginProviderContext context) private static BootstrapResultfinishTestBoot(ModuleFileTransactions transactions, ModuleJarAdmission admission, ModuleClassLoader loader, @Nullable IOException classPathFailure, ModuleBootstraps.Run run, ContributionRegistry contributions, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> testBeanReplacements) Transfers replacements only for test boots that reach enable; Paper has a separate handover.private ContributionLedgerinstallPaperContent(io.papermc.paper.plugin.bootstrap.BootstrapContext context, File dataFolder, ModuleJarAdmission admission, ContributionRegistry contributions, Logger logger) private BootstrapResultprepare(@Nullable io.papermc.paper.plugin.bootstrap.BootstrapContext context, File dataFolder, Logger logger, List<ModuleSource> classPathModules, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> testBeanReplacements) static BootstrapResultprepareWithoutPaperContext(File dataFolder, Logger logger) Runs the shared preparation for an in-process test server that has no Paper bootstrap context.static BootstrapResultprepareWithoutPaperContext(File dataFolder, Logger logger, List<ModuleSource> classPathModules) RunsprepareWithoutPaperContext(File, Logger)with explicit modules already visible to the framework's class loader.static BootstrapResultprepareWithoutPaperContext(File dataFolder, Logger logger, List<ModuleSource> classPathModules, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> replacements) Prepares an in-process boot with bean replacements for explicitly supplied class-path modules.(package private) BootstrapResultresult()snapshotBindings(Class<?> module, @Nullable Map<Class<?>, Object> bindings) snapshotReplacements(List<ModuleSource> sources, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> replacements) Copies both map levels before the in-process boot starts; Paper does not take this path.
-
Field Details
-
result
-
bootstrapFailure
-
-
Constructor Details
-
UltiToolsBootstrap
public UltiToolsBootstrap()
-
-
Method Details
-
bootstrap
public void bootstrap(io.papermc.paper.plugin.bootstrap.BootstrapContext context) - Specified by:
bootstrapin interfaceio.papermc.paper.plugin.bootstrap.PluginBootstrap
-
prepareWithoutPaperContext
Runs the shared preparation for an in-process test server that has no Paper bootstrap context. Only pass a successful handover toUltiTools(BootstrapResult): treat a non-nullBootstrapResult.classPathFailure()as a preparation failure, and report a non-emptyBootstrapResult.modulesRequiringRealServer()as needing a real Paper server.Test server root integration belongs at this entry: acquire a scope with
ServerRoot.overrideForTestBoot(File)before preparation opens module file transactions. Its owner must retain it through plugin disable and release it after cleanup on every failed or aborted start as well. Without that scope, the data folder must have the isolated test server root as its grandparent, as it does on Paper.- Parameters:
dataFolder- the same framework data directory that the test server will give the pluginlogger- where preparation reports go- Returns:
- this test start's handover or its explicit content-channel block
-
prepareWithoutPaperContext
@Internal public static BootstrapResult prepareWithoutPaperContext(File dataFolder, Logger logger, List<ModuleSource> classPathModules) RunsprepareWithoutPaperContext(File, Logger)with explicit modules already visible to the framework's class loader. Their hooks run after the admitted JARs, without changing the JAR admission snapshot or treating a parent-loaded class as belonging to a JAR. An explicit module whose API level fails the same minimum check as a JAR, or whose hook fails, blocks the test boot throughBootstrapResult.classPathFailure(). Such a refusal takes precedence over a request to verify valid content on a real Paper server.- Parameters:
dataFolder- the framework data directory of the isolated test serverlogger- where preparation reports goclassPathModules- module descriptors paired with their compiled classes directories- Returns:
- this test start's handover or its explicit preparation or content-channel block
- Throws:
IllegalArgumentException- if an explicit module root is not a directory
-
prepareWithoutPaperContext
@Internal public static BootstrapResult prepareWithoutPaperContext(File dataFolder, Logger logger, List<ModuleSource> classPathModules, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> replacements) Prepares an in-process boot with bean replacements for explicitly supplied class-path modules. The replacements are snapshotted before preparation and applied at module registration, after discovering the real bean definitions and before constructing any of their instances. Paper's bootstrap cannot supply this map, and ordinary external-plugin connections do not use it.The caller owns each stand-in's initialization and cleanup. The framework binds it as given: it does not autowire or proxy it, invoke
@PostConstructor@PreDestroy, or automatically register it for scheduling, module events, player-cache cleanup, commands or Bukkit events. AOP annotations such as@Transactionaland@ExceptionCatchon the original type do not apply to the stand-in.- Parameters:
dataFolder- the framework data directory of the isolated test serverlogger- where preparation reports goclassPathModules- module descriptors paired with their compiled classes directoriesreplacements- prebuilt stand-ins keyed by the module main class and then dependency type- Returns:
- this test start's handover or its explicit preparation or content-channel block
- Throws:
IllegalArgumentException- if a module was not supplied, its replacement map is null, or a stand-in is null or has the wrong type
-
snapshotReplacements
private static Map<Class<? extends UltiToolsPlugin>, Map<Class<?>,Object>> snapshotReplacements(List<ModuleSource> sources, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> replacements) Copies both map levels before the in-process boot starts; Paper does not take this path. -
snapshotBindings
-
prepare
private BootstrapResult prepare(@Nullable @Nullable io.papermc.paper.plugin.bootstrap.BootstrapContext context, File dataFolder, Logger logger, List<ModuleSource> classPathModules, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> testBeanReplacements) -
finishTestBoot
private static BootstrapResult finishTestBoot(ModuleFileTransactions transactions, ModuleJarAdmission admission, ModuleClassLoader loader, @Nullable @Nullable IOException classPathFailure, ModuleBootstraps.Run run, ContributionRegistry contributions, Map<Class<? extends UltiToolsPlugin>, Map<Class<?>, Object>> testBeanReplacements) Transfers replacements only for test boots that reach enable; Paper has a separate handover. -
installPaperContent
private ContributionLedger installPaperContent(io.papermc.paper.plugin.bootstrap.BootstrapContext context, File dataFolder, ModuleJarAdmission admission, ContributionRegistry contributions, Logger logger) -
channelInstaller
void channelInstaller(io.papermc.paper.plugin.bootstrap.BootstrapContext context, ContributionRegistry contributions, Logger logger) -
classPath
URL[] classPath(ModuleFileTransactions transactions, File dataFolder, @Nullable @Nullable URL serverJar, ModuleJarAdmission admission) throws IOException - Throws:
IOException
-
createPlugin
public org.bukkit.plugin.java.JavaPlugin createPlugin(io.papermc.paper.plugin.bootstrap.PluginProviderContext context) - Specified by:
createPluginin interfaceio.papermc.paper.plugin.bootstrap.PluginBootstrap
-
result
BootstrapResult result()
-