public class ScriptTrait extends Trait
ScriptCompiler
Constructor and Description |
---|
ScriptTrait() |
Modifier and Type | Method and Description |
---|---|
void |
addScripts(List<String> scripts)
Add and load all given script file names
|
List<String> |
getScripts() |
void |
load(DataKey key)
Loads a trait.
|
void |
loadScript(String file)
Compile and load a script given by the file name.
|
void |
removeScripts(List<String> scripts)
Removes the given script file names.
|
void |
run()
Called every tick if overridden.
|
boolean |
validateFile(String file)
Whether the file exists and can be compiled by the system
ScriptCompiler . |
public void addScripts(List<String> scripts)
loadScript(String)
public void loadScript(String file)
file
- the script file name relative to the script folderCitizens.getScriptFolder()
public void run()
Trait
public boolean validateFile(String file)
ScriptCompiler
.Copyright © 2021. All rights reserved.