Skip to content

Commit

Permalink
Fix event pattern on Skript 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikachu920 committed Jan 15, 2024
1 parent b287809 commit c9f0139
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.skriptlang.reflect.syntax.event;

import ch.njol.skript.Skript;
import ch.njol.skript.util.Version;
import com.btk5h.skriptmirror.util.SkriptMirrorUtil;
import org.skriptlang.reflect.syntax.CustomSyntaxStructure;
import org.skriptlang.skript.lang.script.Script;
Expand All @@ -13,6 +15,8 @@ protected EventSyntaxInfo(Script script, String pattern, int matchedPattern) {
}

public static EventSyntaxInfo create(Script script, String pattern, int matchedPattern) {
if (Skript.getVersion().isSmallerThan(new Version(2, 8)))
pattern = "[on] " + pattern + " [with priority (lowest|low|normal|high|highest|monitor)]";
return new EventSyntaxInfo(script, SkriptMirrorUtil.preprocessPattern(pattern), matchedPattern);
}

Expand Down

0 comments on commit c9f0139

Please sign in to comment.