Class DetectSaveFileFormat
java.lang.Object
me.pauleff.converter.plugins.DetectSaveFileFormat
- All Implemented Interfaces:
DefaultPlugin, MOOCPlugin
Detects the world's region save format (Anvil vs McRegion) and stores it on the
PluginContext.
If McRegion is detected, the process exits early because UUID-based conversion is not needed for pre-1.7.6 worlds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(PluginContext ctx) Skips region-file detection for explicit targets, which may be a skeleton without regions.metadata()Returns the metadata that identifies and describes this plugin.voidrun(PluginContext ctx, List<Path> resolvedExistingTargets) Sets the save file format on the context, or exits if McRegion (pre-UUID) is found.setTargets(PluginContext ctx) Returns the world folder as the sole detection target.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MOOCPlugin
logger, returnAllFilesInFolders
-
Constructor Details
-
DetectSaveFileFormat
public DetectSaveFileFormat()
-
-
Method Details
-
metadata
Returns the metadata that identifies and describes this plugin.- Specified by:
metadatain interfaceMOOCPlugin- Returns:
- the plugin metadata
-
isEnabled
Skips region-file detection for explicit targets, which may be a skeleton without regions.- Specified by:
isEnabledin interfaceDefaultPlugin- Specified by:
isEnabledin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
trueunless conversion is limited to a custom folder or file
-
setTargets
Returns the world folder as the sole detection target.- Specified by:
setTargetsin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
- a single-element list containing the world folder
-
run
Sets the save file format on the context, or exits if McRegion (pre-UUID) is found.- Specified by:
runin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion contextresolvedExistingTargets- unused; detection walks the world folder fromctx- Throws:
IOException- if walking the world folder fails
-