diff --git a/src/main/java/io/github/syst3ms/skriptparser/parsing/ScriptLoader.java b/src/main/java/io/github/syst3ms/skriptparser/parsing/ScriptLoader.java index 52f4d40f..ddfb07ff 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/parsing/ScriptLoader.java +++ b/src/main/java/io/github/syst3ms/skriptparser/parsing/ScriptLoader.java @@ -23,15 +23,28 @@ * Contains the logic for loading, parsing and interpreting entire script files */ public class ScriptLoader { + private static final MultiMap triggerMap = new MultiMap<>(); /** - * Parses and loads the provided script in memory - * @param scriptPath the script file to load - * @param debug whether debug is enabled + * Parses and loads the provided script in memory. + * + * @param scriptPath the script file to load. + * @param debug whether debug is enabled. */ public static List loadScript(Path scriptPath, boolean debug) { - var logger = new SkriptLogger(debug); + return loadScript(scriptPath, new SkriptLogger(debug), debug); + } + + /** + * Parses and loads the provided script in memory. + * The provided SkriptLogger can be used within syntaxes to input erroring into the logs during parse time. + * + * @param scriptPath the script file to load. + * @param logger The {@link SkriptLogger} to use for the logged entries. Useful for custom logging. + * @param debug whether debug is enabled. + */ + public static List loadScript(Path scriptPath, SkriptLogger logger, boolean debug) { List elements; String scriptName; try {