Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
45d203d
Update build.gradle and switch to jetbrains annotations
UnderscoreTud Oct 27, 2025
a59dec3
Remove unused import and extra trailing line
UnderscoreTud Oct 27, 2025
106bab3
Rewrite custom syntaxes
UnderscoreTud Jan 2, 2026
25a57af
Make ExprChangeValue return the possible return types
UnderscoreTud Jan 2, 2026
02a4ad8
Register ChangerData
UnderscoreTud Jan 2, 2026
78160ae
Check for array types in accepted classes and add a plurality check
UnderscoreTud Jan 2, 2026
8653bea
Improve return type and plurality handling for ExprExpression
UnderscoreTud Jan 2, 2026
b76caea
Merge branch '2.x' into feature/custom-syntax-rewrite
UnderscoreTud Feb 5, 2026
5a3b907
Resolve conflicts
UnderscoreTud Feb 5, 2026
86aaefb
Finish up the custom event implementation
UnderscoreTud Feb 6, 2026
aae2dc4
Remove debug statements
UnderscoreTud Feb 6, 2026
00d4fb5
Add an expression to reference 'self' for custom syntax
UnderscoreTud Feb 6, 2026
f37f449
Optimize imports
UnderscoreTud Feb 6, 2026
78ebcc0
Store ExpressionsData and ChangerData directly on the structure rathe…
UnderscoreTud Feb 6, 2026
841e0b1
Fix parse error in custom condition.sk
UnderscoreTud Feb 6, 2026
93d233a
Fix index handling in ExprExpression
UnderscoreTud Feb 6, 2026
11bb490
Fix plurality handling for custom property expressions
UnderscoreTud Feb 6, 2026
a6e30f1
Fix 'parse' and 'check' sections load order for custom events
UnderscoreTud Feb 6, 2026
fd36d30
Infer custom expression plurality from return type
UnderscoreTud Feb 9, 2026
2889fb9
Implement ReturnHandler for reflect sections
UnderscoreTud Feb 9, 2026
09d14ef
Store the original context of lazy expressions
UnderscoreTud Feb 9, 2026
cf2b2af
Allow the 'get' section of property expressions to return multiple va…
UnderscoreTud Feb 9, 2026
e90d67b
Fix accepted classes for a changer getting flattened from array type
UnderscoreTud Feb 9, 2026
41e3383
Refactor custom syntax classes to use info classes
UnderscoreTud Feb 13, 2026
8f8d7d9
Store origin on custom syntaxes
UnderscoreTud Mar 14, 2026
5865211
Merge branch '2.x' into feature/custom-syntax-rewrite
UnderscoreTud May 7, 2026
c054722
Migrate to new event value API and move away from dynamically generat…
UnderscoreTud May 26, 2026
bafacce
Fix ExprCustomEvent init
UnderscoreTud May 26, 2026
999184c
Allow CustomEvents to be executed asynchronously
UnderscoreTud May 28, 2026
e94ddf3
Use builtin OriginApplyingSyntaxRegistry
UnderscoreTud May 28, 2026
90bc4d1
Estimate priority
UnderscoreTud May 28, 2026
d44e88f
Remove deprecated raw expression pattern
UnderscoreTud May 28, 2026
7a09d77
Reintroduce custom syntax tracking
UnderscoreTud May 28, 2026
992f766
Replace reflection with proper API call for unloading options
UnderscoreTud May 28, 2026
998503c
Replace useless TriggerEntryData with Skript's equivalent
UnderscoreTud May 28, 2026
c8d9fca
Replace getEnglishPlural with non deprecated method
UnderscoreTud May 28, 2026
bb6b140
Replace ExprEventClasses with proper event value
UnderscoreTud May 28, 2026
6595aff
Delete unused priority constants and ExprEventClasses registration
UnderscoreTud May 28, 2026
583f282
Cache script variable outside loop
UnderscoreTud May 28, 2026
dbd1950
Migrate ExprRawExpression to using infoBuilder
UnderscoreTud May 28, 2026
4853c6c
Move isSingle before getReturnType
UnderscoreTud May 28, 2026
b7ec66f
Delete unused syntax registry class
UnderscoreTud May 28, 2026
e39f093
Cache result of Utils.getSuperType(possibleReturnTypes)
UnderscoreTud May 28, 2026
5b70c69
Annotate custom syntax classes with NoDoc
UnderscoreTud May 28, 2026
ef1b72b
Make `isMarkedContinue` a part of the Continuable interface
UnderscoreTud May 28, 2026
17f34a1
Use pattern matching for instanceof in check method of CondEventCance…
UnderscoreTud May 28, 2026
24bed03
Fix effect sync handling
UnderscoreTud May 29, 2026
6ed522b
Store return type in ExprChangeValue to optimize getReturnType method
UnderscoreTud May 29, 2026
0d78476
Add deprecation warning for missing 'parse' in expressions
UnderscoreTud May 29, 2026
ef687f9
Rename variable
UnderscoreTud May 29, 2026
58c4494
Update Skript dependency to 2.15.3
UnderscoreTud Jun 17, 2026
0a84dea
Rename LazyExpression to CachingExpression
UnderscoreTud Jun 17, 2026
400de64
Add clarifying comment for custom event registration
UnderscoreTud Jun 17, 2026
a2197ea
Add 'raw expression %objects%' back as a valid pattern
UnderscoreTud Jun 17, 2026
0ce9079
Improve local variable tracking
UnderscoreTud Jun 17, 2026
c50f858
Cleanup ExprCustomEvent toString
UnderscoreTud Jun 17, 2026
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
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ tasks.withType(JavaCompile).configureEach {

dependencies {
compileOnly "io.papermc.paper:paper-api:26.1.2.build.+"
compileOnly "com.github.SkriptLang:Skript:2.15.2"
compileOnly "org.ow2.asm:asm:9.9"
compileOnly "com.github.SkriptLang:Skript:2.15.3"
compileOnly "com.github.SkriptLang:Skript:dev~patch-SNAPSHOT"
}
31 changes: 0 additions & 31 deletions src/main/java/com/btk5h/skriptmirror/ParseOrderWorkarounds.java
Comment thread
APickledWalrus marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
package com.btk5h.skriptmirror;

import ch.njol.skript.Skript;
import ch.njol.skript.effects.EffReturn;
import org.skriptlang.reflect.syntax.CustomSyntaxStructure;
import org.skriptlang.reflect.syntax.condition.elements.CustomCondition;
import org.skriptlang.reflect.syntax.condition.elements.StructCustomCondition;
import org.skriptlang.reflect.syntax.effect.elements.CustomEffect;
import org.skriptlang.reflect.syntax.effect.elements.StructCustomEffect;
import org.skriptlang.reflect.syntax.expression.elements.CustomExpression;
import com.btk5h.skriptmirror.skript.EffExpressionStatement;
import com.btk5h.skriptmirror.skript.custom.ExprMatchedPattern;
import com.btk5h.skriptmirror.util.SkriptReflection;
import org.skriptlang.reflect.syntax.expression.elements.StructCustomExpression;
import org.skriptlang.skript.bukkit.registration.BukkitSyntaxInfos;
import org.skriptlang.skript.registration.SyntaxInfo;
import org.skriptlang.skript.registration.SyntaxRegistry;
import org.skriptlang.skript.util.Priority;

import javax.naming.ServiceUnavailableException;
import java.util.Collection;
import java.util.Optional;
import java.util.function.Predicate;

Expand All @@ -36,15 +23,10 @@ public class ParseOrderWorkarounds {

private static final String[] PARSE_ORDER = {
EffExpressionStatement.class.getCanonicalName(),
CustomEffect.class.getCanonicalName(),
CustomCondition.class.getCanonicalName(),
CustomExpression.class.getCanonicalName(),
"com.w00tmast3r.skquery.elements.conditions.CondBoolean",
"com.pie.tlatoani.Miscellaneous.CondBoolean",
"us.tlatoani.tablisknu.core.base.CondBoolean",
"com.pie.tlatoani.CustomEvent.EvtCustomEvent",
EffReturn.class.getCanonicalName(),
ExprMatchedPattern.class.getCanonicalName(),
"ch.njol.skript.effects.EffContinue",
"com.ankoki.skjade.elements.conditions.CondBoolean"
};
Expand All @@ -69,19 +51,6 @@ private static <T> void ensureLast(SyntaxRegistry.Key<? extends SyntaxInfo<? ext
syntaxRegistry.unregister((SyntaxRegistry.Key) elementKey, value);
var newInfo = value.toBuilder().priority(POSITION).build();
syntaxRegistry.register((SyntaxRegistry.Key) elementKey, newInfo);

// need to update custom syntax references
CustomSyntaxStructure.DataTracker<?> tracker = null;
if (elementKey == (SyntaxRegistry.Key) SyntaxRegistry.EFFECT) {
tracker = StructCustomEffect.dataTracker;
} else if (elementKey == (SyntaxRegistry.Key) SyntaxRegistry.CONDITION) {
tracker = StructCustomCondition.dataTracker;
} else if (elementKey == (SyntaxRegistry.Key) SyntaxRegistry.EXPRESSION) {
tracker = StructCustomExpression.dataTracker;
}
if (tracker != null && tracker.getInfo() == value) {
tracker.setInfo(newInfo);
}
});
}

Expand Down
24 changes: 13 additions & 11 deletions src/main/java/com/btk5h/skriptmirror/SkriptMirror.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.btk5h.skriptmirror;

import ch.njol.skript.Skript;
import ch.njol.skript.SkriptAddon;
import ch.njol.skript.classes.ClassInfo;
import ch.njol.skript.registrations.Classes;
import ch.njol.skript.util.Version;
import org.skriptlang.reflect.syntax.custom.CustomSyntaxModule;
import com.btk5h.skriptmirror.skript.CondExpressionStatement;
import com.btk5h.skriptmirror.skript.EffExpressionStatement;
import com.btk5h.skriptmirror.skript.reflect.ExprJavaCall;
Expand All @@ -13,15 +13,16 @@
import com.btk5h.skriptmirror.util.SkriptReflection;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.skriptlang.reflect.syntax.condition.elements.StructCustomCondition;
import org.skriptlang.reflect.syntax.effect.elements.StructCustomEffect;
import org.skriptlang.reflect.syntax.event.elements.ExprCustomEventValue;
import org.skriptlang.reflect.syntax.event.elements.StructCustomEvent;
import org.skriptlang.reflect.syntax.expression.elements.StructCustomExpression;
import org.skriptlang.reflect.syntax.custom.condition.elements.StructCustomCondition;
import org.skriptlang.reflect.syntax.custom.effect.elements.StructCustomEffect;
import org.skriptlang.reflect.syntax.custom.event.elements.StructCustomEvent;
import org.skriptlang.reflect.syntax.custom.expression.elements.StructCustomExpression;
import org.skriptlang.skript.addon.SkriptAddon;
import org.skriptlang.skript.lang.comparator.Comparators;
import org.skriptlang.skript.lang.comparator.Relation;
import org.skriptlang.skript.registration.SyntaxInfo;
import org.skriptlang.skript.registration.SyntaxRegistry;
import org.skriptlang.skript.util.ClassLoader;
import org.skriptlang.skript.util.Priority;

import java.io.IOException;
Expand Down Expand Up @@ -65,12 +66,12 @@ public void onEnable() {
}

try {
getAddonInstance()
.loadClasses("com.btk5h.skriptmirror.skript")
.loadClasses("org.skriptlang.reflect", "syntax", "java.elements");
ClassLoader.loadClasses(SkriptMirror.class, getFile(), "com.btk5h.skriptmirror.skript");
ClassLoader.loadClasses(SkriptMirror.class, getFile(), "org.skriptlang.reflect", "java.elements");

getAddonInstance().loadModules(new CustomSyntaxModule());

SyntaxRegistry registry = addonInstance.syntaxRegistry();
ExprCustomEventValue.register(registry);
ExprJavaCall.register(registry);
CondExpressionStatement.register(registry);
EffExpressionStatement.register(registry);
Expand Down Expand Up @@ -131,7 +132,8 @@ public void onEnable() {

public static SkriptAddon getAddonInstance() {
if (addonInstance == null) {
addonInstance = Skript.registerAddon(getInstance()).setLanguageFileDirectory("lang");
addonInstance = Skript.instance().registerAddon(SkriptMirror.class, "skript-reflect");
addonInstance.localizer().setSourceDirectories("lang", null);
}
return addonInstance;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading