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.
Online conversion requires cached player names. Offline cache entries are resolved via the configured profile API; online cache entries supply the online UUID directly.
-
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 when available.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 when available. A full-server run exits with the legacy-version notice when the file is missing. Custom targets continue without prefetched profiles.- Specified by:
setTargetsin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
- the usercache path, or an empty list if it is missing for a custom target
-
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
-