Interface MOOCPlugin
- All Known Subinterfaces:
DefaultPlugin, MultiServerPlugin, ServerTypePlugin
- All Known Implementing Classes:
ApplyCliServerProperties, ConvertBukkitServer, ConvertFtbQuests, ConvertModdedServer, ConvertVanillaServer, CopyCliPlayerData, DetectSaveFileFormat, DetectServerType, DetectWorldFolderStructure, PrefetchUsercache, UpdateDefaultServerFiles, UpdateProperties
Defines a conversion plugin that can inspect and modify Minecraft server or world files.
Implementations declare metadata, decide when they apply, select target paths, and
perform their work against a shared PluginContext. Specialized sealed subtypes
control enablement for default, single-server, and multi-server plugins.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(PluginContext ctx) Indicates whether this plugin should run for the given context.default org.slf4j.Loggerlogger()Returns a logger named after the runtime class of this plugin.metadata()Returns the metadata that identifies and describes this plugin.returnAllFilesInFolders(List<Path> worldDimensionRootFolders) Collects all regular files under the given world dimension root folders.voidrun(PluginContext ctx, List<Path> resolvedExistingTargets) Executes this plugin's conversion or inspection logic.setTargets(PluginContext ctx) Determines the candidate file or directory paths this plugin may operate on.
-
Method Details
-
logger
default org.slf4j.Logger logger()Returns a logger named after the runtime class of this plugin.- Returns:
- a non-
nullSLF4J logger for this plugin instance
-
metadata
PluginMetadata metadata()Returns the metadata that identifies and describes this plugin.- Returns:
- the plugin metadata
-
setTargets
Determines the candidate file or directory paths this plugin may operate on.Paths need not all exist yet; callers typically resolve and filter them before invoking
run(PluginContext, List).- Parameters:
ctx- the shared conversion context- Returns:
- the list of target paths for this plugin; never
null
-
isEnabled
Indicates whether this plugin should run for the given context.- Parameters:
ctx- the shared conversion context- Returns:
trueif the plugin is applicable;falseotherwise
-
run
Executes this plugin's conversion or inspection logic.Receives only targets that were declared by
setTargets(PluginContext)and confirmed to exist by the caller.- Parameters:
ctx- the shared conversion contextresolvedExistingTargets- the existing target paths to process- Throws:
IOException- if reading or writing server or world files fails
-
returnAllFilesInFolders
Collects all regular files under the given world dimension root folders.Missing roots are skipped with a debug log. Walk failures for a root are logged as warnings and do not abort collection from other roots. The root directories themselves are excluded from the result.
- Parameters:
worldDimensionRootFolders- the world or dimension root directories to walk- Returns:
- all regular files found beneath the existing roots; never
null
-