Skip to content

Commit

Permalink
Potential fix for Checker deprecation - 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGBLP committed Jan 17, 2025
1 parent 39dfcb9 commit 42b4d3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/it/jakegblp/lusk/utils/DeprecationUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.jakegblp.lusk.utils;

import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.Variable;
import ch.njol.skript.util.Timespan;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -57,6 +58,8 @@ public static long getMilliseconds(Timespan timespan) {
public static <T> boolean test(Event event, Expression<T> expr, Predicate<T> predicate) {
if (SKRIPT_2_10) {
return expr.check(event, predicate);
} else if (expr instanceof Variable<T> variable) {
return variable.check(event, predicate);
} else {
try {
Class<?> checkerClass = Class.forName("ch.njol.util.Checker");
Expand Down

0 comments on commit 42b4d3a

Please sign in to comment.