Remove isCurrentEvent for compatibility

This commit is contained in:
Linux User 2025-04-30 14:33:53 +03:00
parent cd039aeeaf
commit 9b8ff05f38
4 changed files with 5 additions and 14 deletions

View File

@ -57,7 +57,7 @@
<dependency> <dependency>
<groupId>com.github.SkriptLang</groupId> <groupId>com.github.SkriptLang</groupId>
<artifactId>Skript</artifactId> <artifactId>Skript</artifactId>
<version>2.6.1</version> <version>2.10.1</version>
<type>jar</type> <type>jar</type>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -67,7 +67,7 @@
</exclusions> </exclusions>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version> <version>1.16.5-R0.1-SNAPSHOT</version>

View File

@ -29,10 +29,7 @@ public class ExprChannel extends SimpleExpression<String> {
@Override @Override
public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) { public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(RedisMessageEvent.class)) {
Skript.error("Cannot use 'redis channel' outside of a redis message event", ErrorQuality.SEMANTIC_ERROR);
return false;
}
return true; return true;
} }

View File

@ -31,10 +31,7 @@ public class ExprMessage extends SimpleExpression<String> {
@Override @Override
public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) { public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(RedisMessageEvent.class)) {
Skript.error("Cannot use 'redis message' outside of a redis message event", ErrorQuality.SEMANTIC_ERROR);
return false;
}
return true; return true;
} }

View File

@ -32,10 +32,7 @@ public class ExprMessageDate extends SimpleExpression<Date> {
@Override @Override
public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) { public boolean init(final Expression<?>[] expressions, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(RedisMessageEvent.class)) {
Skript.error("Cannot use 'redis message date' outside of a redis message event", ErrorQuality.SEMANTIC_ERROR);
return false;
}
return true; return true;
} }
@Override @Override