Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
25 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
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
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ tasks.withType(JavaCompile).configureEach {
dependencies {
compileOnly group: 'io.papermc.paper', name: 'paper-api', version: '1.21.10-R0.1-SNAPSHOT'
compileOnly group: 'com.github.SkriptLang', name: 'Skript', version: '2.14.0'
compileOnly group: 'org.ow2.asm', name: 'asm', version: '9.9'
}
29 changes: 0 additions & 29 deletions src/main/java/com/btk5h/skriptmirror/ParseOrderWorkarounds.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
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 +24,11 @@ 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 +53,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
27 changes: 12 additions & 15 deletions src/main/java/com/btk5h/skriptmirror/SkriptMirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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,11 +14,6 @@
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.skript.lang.comparator.Comparators;
import org.skriptlang.skript.lang.comparator.Relation;
import org.skriptlang.skript.registration.SyntaxInfo;
Expand Down Expand Up @@ -67,10 +63,11 @@ public void onEnable() {
try {
getAddonInstance()
.loadClasses("com.btk5h.skriptmirror.skript")
.loadClasses("org.skriptlang.reflect", "syntax", "java.elements");
.loadClasses("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 @@ -113,14 +110,14 @@ public void onEnable() {
return i;
}));

metrics.addCustomChart(new Metrics.SimplePie("custom_conditions_used",
() -> "" + StructCustomCondition.customConditionsUsed));
metrics.addCustomChart(new Metrics.SimplePie("custom_effects_used",
() -> "" + StructCustomEffect.customEffectsUsed));
metrics.addCustomChart(new Metrics.SimplePie("custom_events_used",
() -> "" + StructCustomEvent.customEventsUsed));
metrics.addCustomChart(new Metrics.SimplePie("custom_expressions_used",
() -> "" + StructCustomExpression.customExpressionsUsed));
// metrics.addCustomChart(new Metrics.SimplePie("custom_conditions_used",
// () -> "" + StructCustomCondition.customConditionsUsed));
// metrics.addCustomChart(new Metrics.SimplePie("custom_effects_used",
// () -> "" + StructCustomEffect.customEffectsUsed));
// metrics.addCustomChart(new Metrics.SimplePie("custom_events_used",
// () -> "" + StructCustomEvent.customEventsUsed));
// metrics.addCustomChart(new Metrics.SimplePie("custom_expressions_used",
// () -> "" + StructCustomExpression.customExpressionsUsed));

metrics.addCustomChart(new Metrics.SimplePie("proxies_used",
() -> "" + ExprProxy.proxiesUsed));
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading