Skip to content

Commit

Permalink
nevermind, it wasn't used, so out the door it goes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth committed Jan 7, 2024
1 parent 2ffeff6 commit a140c55
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/main/java/com/btk5h/skriptmirror/util/SkriptReflection.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import ch.njol.skript.expressions.base.EventValueExpression;
import ch.njol.skript.lang.DefaultExpression;
import ch.njol.skript.lang.ExpressionInfo;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.SyntaxElementInfo;
import ch.njol.skript.registrations.Classes;
import ch.njol.skript.structures.StructOptions;
Expand All @@ -36,7 +35,6 @@ public class SkriptReflection {
private static Method VARIABLES_MAP_COPY;
private static Field DEFAULT_EXPRESSION;
private static Field PARSED_VALUE;
private static Method PARSE_I;
private static Field EXPRESSIONS;
private static Field OPTIONS;

Expand Down Expand Up @@ -101,18 +99,6 @@ public class SkriptReflection {
"therefore and/or warnings won't be suppressed");
}

try {
if (Skript.getVersion().compareTo(2, 8) >= 0) {
_METHOD = SkriptParser.class.getDeclaredMethod("parse_i", String.class);
} else {
_METHOD = SkriptParser.class.getDeclaredMethod("parse_i", String.class, int.class, int.class);
}
_METHOD.setAccessible(true);
PARSE_I = _METHOD;
} catch (NoSuchMethodException e) {
warning("Skript's parse_i method could not be resolved, therefore prioritized loading won't work.");
}

try {
_FIELD = Skript.class.getDeclaredField("expressions");
_FIELD.setAccessible(true);
Expand Down Expand Up @@ -285,20 +271,6 @@ public static void disableAndOrWarnings() {
}
}

/**
* Executes {@link SkriptParser}'s {@code parse_i} method with the given arguments.
*/
public static SkriptParser.ParseResult parse_i(SkriptParser skriptParser, String pattern, int i, int j) {
if (PARSE_I == null)
return null;

try {
return (SkriptParser.ParseResult) PARSE_I.invoke(skriptParser, pattern, i, j);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}

/**
* {@return} a list of all of Skript's registered {@link ch.njol.skript.lang.Expression}s.
*/
Expand Down

0 comments on commit a140c55

Please sign in to comment.