Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skript 2.8-pre1 #162

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repositories {

dependencies {
shadow 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
shadow 'com.github.SkriptLang:Skript:2.7.0-beta2'
shadow 'com.github.SkriptLang:Skript:2.8.0-pre1'
// Jetbrains Annotations
shadow 'org.jetbrains:annotations:23.0.0'

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/info/itsthesky/disky/api/ReflectionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ public static void removeElement(String clazz, String... fields) throws Exceptio

if (f.equalsIgnoreCase("expressions")) {
((Collection<ExpressionInfo<?, ?>>) field.get(null))
.removeIf(info -> info.c.equals(clz));
.removeIf(info -> info.getElementClass().equals(clz));
} else {
((Collection<SyntaxElementInfo<? extends Effect>>) field.get(null))
.removeIf(info -> info.c.equals(clz));
.removeIf(info -> info.getElementClass().equals(clz));
}

field.setAccessible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public boolean init(Literal<?> @NotNull [] exprs, int matchedPattern, @NotNull S

String name = null;
for (SkriptEventInfo<?> event : Skript.getEvents()) {
if (bukkitClass.equals(event.c)) {
if (bukkitClass.equals(event.getElementClass())) {
name = event.getName();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public static class SimpleDocElement {
private final @Nullable String module;

public SimpleDocElement(SyntaxElementInfo<?> info) {
this.id = getAnnotationOr(info, DocumentationId.class, info.c.getSimpleName());
this.id = getAnnotationOr(info, DocumentationId.class, info.getElementClass().getSimpleName());
this.name = getAnnotationOr(info, Name.class, null);
this.description = getAnnotationOrs(info, Description.class, null);
this.patterns = info.getPatterns();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private CommandFactory() {

Method _PARSE_I = null;
try {
_PARSE_I = SkriptParser.class.getDeclaredMethod("parse_i", String.class, int.class, int.class);
_PARSE_I = SkriptParser.class.getDeclaredMethod("parse_i", String.class);
_PARSE_I.setAccessible(true);
} catch (NoSuchMethodException e) {
e.printStackTrace();
Expand All @@ -61,7 +61,7 @@ public boolean parseArguments(String args, CommandObject command, Event event) {
SkriptParser parser = new SkriptParser(args, SkriptParser.PARSE_LITERALS, ParseContext.COMMAND);
SkriptParser.ParseResult res = null;
try {
res = (SkriptParser.ParseResult) PARSE_I.invoke(parser, command.getPattern(), 0, 0);
res = (SkriptParser.ParseResult) PARSE_I.invoke(parser, command.getPattern());
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected void execute(@NotNull Event e) {
if (parent instanceof SecLoop) {
((SecLoop) parent).exit(e);
} else if (parent instanceof SecWhile) {
((SecWhile) parent).reset();
((SecWhile) parent).exit(e);
}
parent = parent.getParent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean preLoad() {
.toUpperCase().replace(" ", "_")));
options.setFlags(
Stream.of(container.getOptional("cache flags", String[].class, true))
.map(str -> CacheFlag.valueOf(str.toUpperCase().replace(" ", "_")))
.map(str -> CacheFlag.valueOf(str.toString().toUpperCase().replace(" ", "_")))
.toArray(CacheFlag[]::new)
);
options.setPolicy(parse(container.getOptional("policy", String.class, true)));
Expand All @@ -96,7 +96,7 @@ public boolean preLoad() {
options.setOnGuildReady(guildReady == null ? new ArrayList<>() : Collections.singletonList(guildReady));

options.setIntents(Stream.of(container.getOptional("intents", String[].class, true))
.map(str -> GatewayIntent.valueOf(str.toUpperCase().replace(" ", "_")))
.map(str -> GatewayIntent.valueOf(str.toString().toUpperCase().replace(" ", "_")))
.toArray(GatewayIntent[]::new));

return true;
Expand Down
Loading