Class PrefetchUsercache
java.lang.Object
me.pauleff.converter.plugins.PrefetchUsercache
- All Implemented Interfaces:
DefaultPlugin, MOOCPlugin
Prefills the context UUID map from
usercache.json for an online/offline conversion.
Exits early when usercache.json is missing, which usually indicates a pre-1.7.6 server
that does not need UUID conversion.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(PluginContext ctx) Returnstruewhen an online/offline conversion was requested.metadata()Returns the metadata that identifies and describes this plugin.voidrun(PluginContext ctx, List<Path> resolvedExistingTargets) Loads known players from each resolved usercache and stores UUID remappings on the context.setTargets(PluginContext ctx) Returnsusercache.jsonunder the server folder, or exits if the file is absent.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MOOCPlugin
logger, returnAllFilesInFolders
-
Constructor Details
-
PrefetchUsercache
public PrefetchUsercache()
-
-
Method Details
-
metadata
Returns the metadata that identifies and describes this plugin.- Specified by:
metadatain interfaceMOOCPlugin- Returns:
- the plugin metadata
-
isEnabled
Returnstruewhen an online/offline conversion was requested.- Specified by:
isEnabledin interfaceDefaultPlugin- Specified by:
isEnabledin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
trueif this is a conversion operation;falseotherwise
-
setTargets
Returnsusercache.jsonunder the server folder, or exits if the file is absent.- Specified by:
setTargetsin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
- a single-element list containing the usercache path
-
run
Loads known players from each resolved usercache and stores UUID remappings on the context.- Specified by:
runin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion contextresolvedExistingTargets- the existing usercache paths to read- Throws:
IOException- if reading a usercache file fails
-