Class DetectServerType
java.lang.Object
me.pauleff.converter.plugins.DetectServerType
- All Implemented Interfaces:
DefaultPlugin, MOOCPlugin
Detects whether the server root is Vanilla, Bukkit-based, or modded and stores the
result on the
PluginContext.
Defaults to Vanilla, then upgrades to Modded or Bukkit when characteristic folders or files are present.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmetadata()Returns the metadata that identifies and describes this plugin.voidrun(PluginContext ctx, List<Path> resolvedExistingTargets) Sets the context server type to Vanilla, Modded, or Bukkit based on root layout.setTargets(PluginContext ctx) Returns the server root 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 DefaultPlugin
isEnabledModifier and TypeMethodDescriptiondefault booleanisEnabled(PluginContext ctx) Always returnstrue, so the plugin runs for everyPluginContext.Methods inherited from interface MOOCPlugin
logger, returnAllFilesInFolders
-
Constructor Details
-
DetectServerType
public DetectServerType()
-
-
Method Details
-
metadata
Returns the metadata that identifies and describes this plugin.- Specified by:
metadatain interfaceMOOCPlugin- Returns:
- the plugin metadata
-
setTargets
Returns the server root folder as the sole detection target.- Specified by:
setTargetsin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion context- Returns:
- a single-element list containing the server folder
-
run
Sets the context server type to Vanilla, Modded, or Bukkit based on root layout.- Specified by:
runin interfaceMOOCPlugin- Parameters:
ctx- the shared conversion contextresolvedExistingTargets- unused; detection inspects the server folder fromctx- Throws:
IOException- if I/O fails while detecting the server type
-