Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b22d87f
Progress so far
TheLimeGlass Apr 26, 2023
1cac4d8
Merge branch 'master' of https://github.com/SkriptLang/Skript into en…
TheLimeGlass Apr 26, 2023
b35fa99
Finalize SQL database system
TheLimeGlass Apr 26, 2023
5babe26
Remove comments
TheLimeGlass Apr 26, 2023
19e3848
Remove SQLibrary
TheLimeGlass Apr 26, 2023
038cfdd
Complete SQL rework
TheLimeGlass Apr 26, 2023
b733bc9
Formatting
TheLimeGlass Apr 26, 2023
31ce091
Tackle some todo list nodes
TheLimeGlass Apr 27, 2023
f55d702
Class check
TheLimeGlass Apr 27, 2023
3f7b78a
Update to dev/feature
TheLimeGlass Nov 13, 2023
47f0adf
Apply changes
TheLimeGlass Nov 13, 2023
0117ad9
changes
TheLimeGlass Nov 14, 2023
c01537f
Add SkriptAddon reference to the storage
TheLimeGlass Dec 17, 2023
f18dac0
Add SQLite tests
TheLimeGlass Dec 17, 2023
d441bda
Fix MySQL
TheLimeGlass Dec 17, 2023
8f60b01
licence
TheLimeGlass Dec 17, 2023
18670ac
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Dec 17, 2023
b1e35a2
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Dec 17, 2023
e758d56
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Feb 20, 2024
b791ffe
Complete MySQL
TheLimeGlass Feb 20, 2024
4afaacb
Merge branch 'dev/feature' into enhancement/sql
Moderocky Mar 26, 2024
c3d07b1
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass May 13, 2024
46ee7fa
Fix java21 folder reference'
TheLimeGlass May 13, 2024
7dad632
Better get method design. Monitor changes fixes. SQL tweaks
TheLimeGlass May 13, 2024
2c71679
Undo rowid SQLite test
TheLimeGlass May 13, 2024
fadcc0d
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Jul 2, 2024
e3fd27f
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Aug 17, 2024
427f0ee
Conflicts
TheLimeGlass Sep 20, 2024
d6c2608
Conflicts
TheLimeGlass Sep 20, 2024
cb9842f
Code cleaning and security
TheLimeGlass Sep 20, 2024
8be6d63
Code cleaning and security
TheLimeGlass Sep 20, 2024
980ddfd
Update Hikari and H2
TheLimeGlass Sep 20, 2024
37314d3
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Oct 12, 2024
217ecfd
git conflicts
TheLimeGlass Nov 16, 2024
ecb416f
Aliases
TheLimeGlass Nov 16, 2024
3a2f722
More git conflicts
TheLimeGlass Nov 16, 2024
349b1c2
Git conflicts for 2.10.1
TheLimeGlass Feb 27, 2025
8877860
Apply suggestions from code review
TheLimeGlass Mar 12, 2025
8b94207
Update src/main/java/ch/njol/skript/variables/JdbcStorage.java
TheLimeGlass Mar 12, 2025
a8cf8cd
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Mar 12, 2025
b7e1b58
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Apr 15, 2025
f170cc7
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Jun 3, 2025
949e7b8
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Jun 3, 2025
9b82943
Remove weird git conflict addition
TheLimeGlass Jun 3, 2025
b392693
Remove weird git conflict addition
TheLimeGlass Jun 3, 2025
907b2b9
Git conflicts
TheLimeGlass Jul 16, 2025
49eb9f9
Requested changes
TheLimeGlass Jul 16, 2025
2e00163
Git conflicts
TheLimeGlass Jul 16, 2025
4ae8741
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Jul 21, 2025
1603334
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Aug 12, 2025
b399c38
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Sep 10, 2025
5b94e07
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Oct 2, 2025
8e29968
Merge branch 'dev/feature' into enhancement/sql
TheLimeGlass Oct 18, 2025
f75c8d9
Merge branch 'dev/feature' into enhancement/sql
sovdeeth Jan 19, 2026
e0ab53d
replaced VariablesMap with thread safe radix tree implementation
Pesekjak Jan 26, 2026
626e96c
fixed the cache maximum size (weight),
Pesekjak Jan 26, 2026
4f58498
resolved conflicts
Pesekjak Jan 27, 2026
a294665
improved the writing efficiency of single variables
Pesekjak Jan 30, 2026
3d98df6
removed the cache from variables map as its implementation for the ra…
Pesekjak Jan 31, 2026
efd5051
improved efficiency of the variables map for clearing, pruning does n…
Pesekjak Jan 31, 2026
fd83c25
variable storage rework yay
Pesekjak Jan 31, 2026
8b8d49b
Merge branch 'dev/feature' into feature/variable-storage-improvements
sovdeeth Jan 31, 2026
18904b4
get list variable now does not return a copy but unmodifiable view of…
Pesekjak Feb 2, 2026
2393bf2
Merge remote-tracking branch 'origin/feature/variable-storage-improve…
Pesekjak Feb 2, 2026
f436d30
improved the efficiency of returning large lists from the variables m…
Pesekjak Feb 6, 2026
e46d63a
now node is backed by a concurrent map, lock overhead was reduced,
Pesekjak Feb 7, 2026
08659e5
expanded the jdbc storage api,
Pesekjak Feb 7, 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
16 changes: 13 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ dependencies {
exclude group: 'org.bukkit', module: 'bukkit'
}

// Libraries that are installed at runtime. See plugin.yml 'libraries' section.
implementation group: 'com.h2database', name: 'h2', version: project.property('h2.version')
implementation group: 'com.zaxxer', name: 'HikariCP', version: project.property('hikaricp.version')

implementation fileTree(dir: 'lib', include: '*.jar')

testShadow group: 'junit', name: 'junit', version: '4.13.2'
Expand Down Expand Up @@ -311,6 +315,15 @@ if (project.hasProperty('junit') && (project.property('junit') as String).toLowe
createTestTask('customTest', 'Runs tests based on provided parameters.', customEnvironments, envJava, customTimeout, customModifiers.toArray(new Modifiers[0]) as Modifiers[])
// end custom test task

// Generic replace tokens, e.g: '@version@'
tasks.withType(Copy).configureEach {
filter(ReplaceTokens, tokens: [
'today' : '' + LocalTime.now(),
'h2.version' : project.property('h2.version'),
'hikaricp.version' : project.property('hikaricp.version')
])
}

// Build flavor configurations
tasks.register('githubResources', ProcessResources) {
from 'src/main/resources', {
Expand All @@ -321,7 +334,6 @@ tasks.register('githubResources', ProcessResources) {
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
'today' : '' + LocalTime.now(),
'release-flavor' : 'skriptlang-github', // SkriptLang build, distributed on Github
'release-channel' : channel, // Release channel, see above
'release-updater' : 'ch.njol.skript.update.GithubChecker', // Github API client
Expand Down Expand Up @@ -354,7 +366,6 @@ tasks.register('spigotResources', ProcessResources) {
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
'today' : '' + LocalTime.now(),
'release-flavor' : 'skriptlang-spigot', // SkriptLang build, distributed on Spigot resources
'release-channel' : channel, // Release channel, see above
'release-updater' : 'ch.njol.skript.update.GithubChecker', // Github API client
Expand Down Expand Up @@ -385,7 +396,6 @@ tasks.register('nightlyResources', ProcessResources) {
version = project.property('version') + '-nightly-' + hash
filter ReplaceTokens, tokens: [
'version' : version,
'today' : '' + LocalTime.now(),
'release-flavor' : 'skriptlang-nightly', // SkriptLang build, automatically done by CI
'release-channel' : 'prerelease', // No update checking, but these are VERY unstable
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No auto updates for now
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ version=2.14.0
jarName=Skript.jar
testEnv=java21/paper-1.21.11
testEnvJavaVersion=21

hikaricp.version=5.1.0
h2.version=2.3.232
Binary file removed lib/SQLibrary-7.1.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main/java/ch/njol/skript/SkriptAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

import ch.njol.skript.util.Utils;
import ch.njol.skript.util.Version;
import ch.njol.skript.variables.VariableStorage;
import ch.njol.skript.variables.Variables;

import org.jetbrains.annotations.ApiStatus;
import org.skriptlang.skript.localization.Localizer;
import org.skriptlang.skript.registration.SyntaxRegistry;
import org.skriptlang.skript.util.Registry;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ch/njol/skript/effects/Delay.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import ch.njol.skript.timings.SkriptTimings;
import ch.njol.skript.util.Timespan;
import ch.njol.skript.variables.Variables;
import ch.njol.skript.variables.VariablesMap;
import ch.njol.util.Kleenean;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
Expand Down Expand Up @@ -72,7 +73,7 @@ protected TriggerItem walk(Event event) {
return null;

// Back up local variables
Object localVars = Variables.removeLocals(event);
VariablesMap localVars = Variables.removeLocals(event);

Bukkit.getScheduler().scheduleSyncDelayedTask(Skript.getInstance(), () -> {
addDelayedEvent(event);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ch/njol/skript/effects/EffTeleport.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ch.njol.skript.timings.SkriptTimings;
import ch.njol.skript.util.Direction;
import ch.njol.skript.variables.Variables;
import ch.njol.skript.variables.VariablesMap;
import ch.njol.util.Kleenean;
import io.papermc.lib.PaperLib;
import io.papermc.lib.environments.PaperEnvironment;
Expand Down Expand Up @@ -131,7 +132,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
}

final Location fixed = location;
Object localVars = Variables.removeLocals(event);
VariablesMap localVars = Variables.removeLocals(event);

// This will either fetch the chunk instantly if on Spigot or already loaded or fetch it async if on Paper.
PaperLib.getChunkAtAsync(location).thenAccept(chunk -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ch.njol.skript.effects;

import ch.njol.skript.variables.VariablesMap;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -28,7 +29,7 @@ protected TriggerItem walk(Event event) {
return null;

// Back up local variables
Object localVars = Variables.removeLocals(event);
VariablesMap localVars = Variables.removeLocals(event);

Bukkit.getScheduler().scheduleSyncDelayedTask(Skript.getInstance(), () -> {
Delay.addDelayedEvent(event);
Expand Down
22 changes: 12 additions & 10 deletions src/main/java/ch/njol/skript/lang/Variable.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
package ch.njol.skript.lang;

import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import java.util.function.Predicate;
import java.util.function.Function;

import ch.njol.skript.Skript;
import ch.njol.skript.SkriptAPIException;
import ch.njol.skript.SkriptConfig;
import ch.njol.skript.classes.Changer;
import ch.njol.skript.classes.Changer.ChangeMode;
import ch.njol.skript.classes.Changer.ChangerUtils;
import ch.njol.skript.classes.ClassInfo;
import ch.njol.skript.variables.VariableStorage;
import org.skriptlang.skript.lang.arithmetic.Arithmetics;
import org.skriptlang.skript.lang.arithmetic.OperationInfo;
import org.skriptlang.skript.lang.arithmetic.Operator;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.parser.ParserInstance;
import ch.njol.skript.lang.util.SimpleExpression;
Expand All @@ -27,21 +38,12 @@
import org.bukkit.event.Event;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.arithmetic.Arithmetics;
import org.skriptlang.skript.lang.arithmetic.OperationInfo;
import org.skriptlang.skript.lang.arithmetic.Operator;
import org.skriptlang.skript.lang.comparator.Comparators;
import org.skriptlang.skript.lang.comparator.Relation;
import org.skriptlang.skript.lang.converter.Converters;
import org.skriptlang.skript.lang.script.Script;
import org.skriptlang.skript.lang.script.ScriptWarning;

import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Function;
import java.util.function.Predicate;

public class Variable<T> implements Expression<T>, KeyReceiverExpression<T>, KeyProviderExpression<T> {

private final static String SINGLE_SEPARATOR_CHAR = ":";
Expand Down Expand Up @@ -403,7 +405,7 @@ public Iterator<KeyedValue<T>> keyedIterator(Event event) {
return Iterators.filter(transformed, Objects::nonNull);
}

public Iterator<Pair<String, Object>> variablesIterator(Event event) {
public Iterator<KeyedValue<Object>> variablesIterator(Event event) {
if (!list)
throw new SkriptAPIException("Looping a non-list variable");
return Variables.getVariableIterator(name.toString(event), local, event);
Expand Down
Loading