Interface IScriptRunManager
- All Known Implementing Classes:
ScriptRunManager
IScriptRuns, while also dealing with IActions.- Since:
- 9.1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyAction(IAction action) Applies the given action.createScriptRun(ScriptRunConfiguration configuration) Creates aIScriptRunwith the specifiedScriptRunConfiguration.createScriptRun(Path root, ScriptRunConfiguration configuration) Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting all valid scripts from the givenroot.createScriptRun(Path root, List<Path> files, ScriptRunConfiguration configuration) Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting the script files in thefileslist.createScriptRun(List<SourceFile> sources, ScriptRunConfiguration configuration) Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting the given ZenCodeSourceFiles.Obtains theIScriptRunInfoof the currently executingIScriptRun, if any.
-
Method Details
-
createScriptRun
Creates aIScriptRunwith the specifiedScriptRunConfiguration.The script run will execute all scripts that are present in the default scripts directory. In this instance, a valid script file is identified by a
PathwhoseBasicFileAttributesreport a regular file and whose file name ends with.zs.- Parameters:
configuration- The configuration of the script run.- Returns:
- A script run that carries out the specified operations.
- Since:
- 9.1.0
-
createScriptRun
Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting all valid scripts from the givenroot.In this instance, a valid script file is identified by a
PathwhoseBasicFileAttributesreport a regular file and whose file name ends with.zs.- Parameters:
root- The rootPathfrom which CraftTweaker should look for scripts.configuration- The configuration of the script run.- Returns:
- A script run that carries out the specified operations.
- Since:
- 9.1.0
-
createScriptRun
Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting the script files in thefileslist.In this instance, all
Paths given infilesare assumed to be valid files. The path given as root, on the other hand, is used to properly identify the name of the script file for the ZenCode scripting environment. For this reason, it is mandatory forrootto be a valid parent of all files listed in thefileslist.- Parameters:
root- The root which contains all files listed infiles.files- The files that CraftTweaker should execute in the script run.configuration- The configuration of the script run.- Returns:
- A script run that carries out the specified operations.
- Since:
- 9.1.0
-
createScriptRun
Creates aIScriptRunwith the specifiedScriptRunConfigurationexecuting the given ZenCodeSourceFiles.No restrictions are imposed on the type of the source files given.
- Parameters:
sources- The source files to execute in the script run.configuration- The configuration of the script run.- Returns:
- A script run that carries out the specified operations.
- Since:
- 9.1.0
-
currentRunInfo
IScriptRunInfo currentRunInfo()Obtains theIScriptRunInfoof the currently executingIScriptRun, if any.If no script run is currently executing, a
NullPointerExceptionis thrown instead. It is the caller's responsibility to verify that this method can only ever be called during a script run execution.A script run is considered executing only when its
IScriptRun.execute()method is operating.To get information for a specific script run, consider using
IScriptRun.specificRunInfo()instead.- Returns:
- The information for the currently executing script run, if any.
- Since:
- 9.1.0
-
applyAction
Applies the given action.Application of the action requires a
IScriptRunto be currently executing. Attempting to apply an action outside of a script run will result in anIllegalStateExceptionbeing thrown.- Parameters:
action- The action to apply.- Since:
- 9.1.0
-