Skip to content

Commit d0f806e

Browse files
authored
Merge branch 'dev/feature' into src/main/resources
2 parents 39a6d5f + aea3176 commit d0f806e

File tree

70 files changed

+1586
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1586
-601
lines changed

.github/workflows/checkstyle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
submodules: recursive
1818
- name: validate gradle wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: Set up JDK 21
2121
uses: actions/setup-java@v4
2222
with:

.github/workflows/java-17-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
submodules: recursive
1818
- name: validate gradle wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: Set up JDK 21
2121
uses: actions/setup-java@v4
2222
with:

.github/workflows/java-21-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
submodules: recursive
1818
- name: validate gradle wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: Set up JDK 21
2121
uses: actions/setup-java@v4
2222
with:

.github/workflows/junit-17-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
submodules: recursive
1818
- name: validate gradle wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: Set up JDK 21
2121
uses: actions/setup-java@v4
2222
with:

.github/workflows/junit-21-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
submodules: recursive
1818
- name: validate gradle wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: Set up JDK 21
2121
uses: actions/setup-java@v4
2222
with:

.github/workflows/repo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
with:
1313
submodules: recursive
1414
- name: validate gradle wrapper
15-
uses: gradle/wrapper-validation-action@v2
15+
uses: gradle/actions/wrapper-validation@v4
1616
- name: Set up JDK 21
1717
uses: actions/setup-java@v4
1818
with:

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ fabric.properties
166166

167167
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
168168

169+
# Exception for the icon
170+
!.idea/icon.png
171+
169172
*.iml
170173
modules.xml
171174
.idea/misc.xml

.idea/icon.png

4.07 KB
Loading

CLOCKWORK_RELEASE_MODEL.md

+26-14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ This document does *not* cover the distribution or publication of artifacts buil
3434

3535
Plans for a new release model began in March 2023 and several models were discussed, with this being the final version agreed upon by the organisation's administrative group and approved by the core contributors.
3636

37+
An update to the release model was made in February 2025 to accommodate a more frequent Minecraft release schedule and to help limit update sizes further.
38+
3739
### Motivations
3840

3941
The release cycle for the `2.7.0` version was significant in that it took an unusually long time and included an unusually-large number of additions and changes.
@@ -59,6 +61,11 @@ Members of the organisation and the wider community identified several problems
5961

6062
Of these, the principle complaint is that the `2.7.0` version took a significant amount of time to finish and this had an adverse effect on the community and the wider ecosystem.
6163

64+
As of February 2025, Mojang has committed to 'drops', which means significant upstream changes happen much more frequently.
65+
This corresponds to Skript having a much higher lag time on releasing support for new content due to the mismatch in release dates.
66+
In addition, an uptick in contributions has led to `2.10` being one of the largest updates yet.
67+
The size of the update meant that some of the previous concerns, like short notice additions and an extensive changelog, were still persistent despite the new release schedule.
68+
6269
### Goals
6370

6471
Our release model has been designed to achieve the following goals:
@@ -98,6 +105,7 @@ A 'patch' version (labelled `0.0.X`) may contain:
98105
- Bug fixes
99106
- Non-impactful<sup>2</sup> improvements to existing features
100107
- Changes to meta content (e.g. documentation)
108+
- Opt-in experiments
101109

102110
There may be **very rare** occasions when a breaking change is necessary in a patch release. These may occur if and only if: either a breaking change is required in order to fix an issue, and the issue is significant enough to need fixing in a patch rather than waiting for a major release, or an issue occurred with an inclusion in the version immediately-prior to this, which must be changed or reverted in some way.
103111

@@ -138,18 +146,20 @@ A table of (expected) dates is displayed below.
138146
| 15th Jan | Feature release | 0.1.0 |
139147
| 1st Feb | Patch | 0.1.1 |
140148
| 1st Mar | Patch | 0.1.2 |
141-
| 1st Apr | Patch | 0.1.3 |
142-
| 1st May | Patch | 0.1.4 |
143-
| 1st Jun | Patch | 0.1.5 |
144-
| 1st Jul | Pre-release | 0.2.0-pre1 |
145-
| 15th Jul | Feature release | 0.2.0 |
146-
| 1st Aug | Patch | 0.2.1 |
147-
| 1st Sep | Patch | 0.2.2 |
148-
| 1st Oct | Patch | 0.2.3 |
149-
| 1st Nov | Patch | 0.2.4 |
150-
| 1st Dec | Patch | 0.2.5 |
151-
152-
An estimated 14 releases are expected per year, with 10 patches, 2 pre-releases and 2 feature-releases that immediately follow them.
149+
| 1st Apr | Pre-release | 0.2.0-pre1 |
150+
| 15th Apr | Feature release | 0.2.0 |
151+
| 1st May | Patch | 0.2.1 |
152+
| 1st Jun | Patch | 0.2.2 |
153+
| 1st Jul | Pre-release | 0.3.0-pre1 |
154+
| 15th Jul | Feature release | 0.3.0 |
155+
| 1st Aug | Patch | 0.3.1 |
156+
| 1st Sep | Patch | 0.3.2 |
157+
| 1st Oct | Pre-release | 0.4.0-pre1 |
158+
| 15th Oct | Feature release | 0.4.0 |
159+
| 1st Nov | Patch | 0.4.1 |
160+
| 1st Dec | Patch | 0.4.2 |
161+
162+
An estimated 16 releases are expected per year, with 8 patches, 4 pre-releases and 4 feature-releases.
153163

154164
Please note that the actual number may differ from this in cases such as:
155165
- A version requiring multiple pre-releases to correct mistakes (`0.3.0-pre1`, `0.3.0-pre2`)
@@ -160,15 +170,17 @@ There is no fixed timetable for the circulation of unpublished builds to the pub
160170

161171
### Major Version Schedule
162172

163-
A [feature version](#feature-releases) will be released on the **15th of January** and the **15th of July**.
173+
A [feature version](#feature-releases) will be released on the **15th of January**, the **15th of April**, the **15th of July**, and the **15th of October**.
164174

165-
This will include all finished content from the previous 6 months that was tested in the pre-release.
175+
This will include all finished content that was tested in the pre-release.
166176

167177
Any features, additions or changes that were *not* ready or approved at the time of the pre-release may **not** be included in the feature release [according to goal 3](#goals). \
168178
The feature release must **not** be delayed to accomodate content that was not ready by the deadline [according to goal 5](#goals).
169179

170180
If there is no content ready at the scheduled date of a feature release, the release will be skipped and a notice published explaining this.
171181

182+
The April and October releases are intended to include minimal breaking changes and focus more on including new features and opt-in experiments.
183+
172184
### Pre-Release Schedule
173185

174186
A [pre-release](#pre-releases) will be released on the **1st of January** and the **1st of July**, leaving two weeks before the following release for public testing to occur.

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ allprojects {
2727

2828
dependencies {
2929
shadow group: 'io.papermc', name: 'paperlib', version: '1.0.8'
30-
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
31-
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'
30+
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.1.0'
31+
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.4'
3232

3333
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.4-R0.1-SNAPSHOT'
3434
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
3535

3636
// bundled with Minecraft 1.19.4+ for display entity transforms
37-
implementation group: 'org.joml', name: 'joml', version: '1.10.5'
37+
implementation group: 'org.joml', name: 'joml', version: '1.10.8'
3838

3939
// Plugin hook libraries
4040
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT', {
@@ -48,7 +48,7 @@ dependencies {
4848
implementation fileTree(dir: 'lib', include: '*.jar')
4949

5050
testShadow group: 'junit', name: 'junit', version: '4.13.2'
51-
testShadow group: 'org.easymock', name: 'easymock', version: '5.4.0'
51+
testShadow group: 'org.easymock', name: 'easymock', version: '5.5.0'
5252
}
5353

5454
checkstyle {

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.parallel=true
55

66
groupid=ch.njol
77
name=skript
8-
version=2.10.0
8+
version=2.10.2
99
jarName=Skript.jar
1010
testEnv=java21/paper-1.21.4
1111
testEnvJavaVersion=21

skript-aliases

src/main/java/ch/njol/skript/Skript.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
import ch.njol.util.StringUtils;
4545
import ch.njol.util.coll.iterator.CheckedIterator;
4646
import ch.njol.util.coll.iterator.EnumerationIterable;
47-
import com.google.common.collect.Lists;
4847
import com.google.gson.Gson;
4948
import com.google.gson.GsonBuilder;
49+
import io.papermc.lib.PaperLib;
5050
import org.bstats.bukkit.Metrics;
5151
import org.bukkit.*;
5252
import org.bukkit.command.CommandSender;
@@ -683,7 +683,7 @@ protected void afterErrors() {
683683
if (TestMode.DEV_MODE) {
684684
runTests(); // Dev mode doesn't need a delay
685685
} else {
686-
Bukkit.getWorlds().get(0).getChunkAtAsync(100, 100).thenRun(() -> runTests());
686+
PaperLib.getChunkAtAsync(Bukkit.getWorlds().get(0), 100, 100).thenRun(() -> runTests());
687687
}
688688
}
689689

src/main/java/ch/njol/skript/SkriptCommand.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -382,19 +382,21 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
382382

383383
} else if (args[0].equalsIgnoreCase("gen-docs")) {
384384
File templateDir = Documentation.getDocsTemplateDirectory();
385+
File outputDir = Documentation.getDocsOutputDirectory();
386+
outputDir.mkdirs();
387+
388+
Skript.info(sender, "Generating docs...");
389+
JSONGenerator jsonGenerator = new JSONGenerator(templateDir, outputDir);
390+
jsonGenerator.generate();
391+
385392
if (!templateDir.exists()) {
386-
Skript.error(sender, "Cannot generate docs! Documentation templates not found at '" + Documentation.getDocsTemplateDirectory().getPath() + "'");
387-
TestMode.docsFailed = true;
393+
Skript.info(sender, "JSON-only documentation generated!");
388394
return true;
389395
}
390-
File outputDir = Documentation.getDocsOutputDirectory();
391-
outputDir.mkdirs();
396+
392397
HTMLGenerator htmlGenerator = new HTMLGenerator(templateDir, outputDir);
393-
JSONGenerator jsonGenerator = new JSONGenerator(templateDir, outputDir);
394-
Skript.info(sender, "Generating docs...");
395398
htmlGenerator.generate(); // Try to generate docs... hopefully
396-
jsonGenerator.generate();
397-
Skript.info(sender, "Documentation generated!");
399+
Skript.info(sender, "All documentation generated!");
398400
} else if (args[0].equalsIgnoreCase("test") && TestMode.DEV_MODE) {
399401
File scriptFile;
400402
if (args.length == 1) {

src/main/java/ch/njol/skript/classes/data/BukkitClasses.java

+22-33
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import ch.njol.skript.aliases.ItemType;
77
import ch.njol.skript.bukkitutil.BukkitUtils;
88
import ch.njol.skript.bukkitutil.EntityUtils;
9-
import ch.njol.skript.bukkitutil.SkriptTeleportFlag;
109
import ch.njol.skript.bukkitutil.ItemUtils;
10+
import ch.njol.skript.bukkitutil.SkriptTeleportFlag;
1111
import ch.njol.skript.classes.*;
1212
import ch.njol.skript.classes.registry.RegistryClassInfo;
1313
import ch.njol.skript.entity.EntityData;
@@ -21,6 +21,7 @@
2121
import ch.njol.skript.util.BlockUtils;
2222
import ch.njol.skript.util.PotionEffectUtils;
2323
import ch.njol.skript.util.StringMode;
24+
import ch.njol.skript.util.Utils;
2425
import ch.njol.util.StringUtils;
2526
import ch.njol.yggdrasil.Fields;
2627
import io.papermc.paper.world.MoonPhase;
@@ -71,10 +72,7 @@ public class BukkitClasses {
7172

7273
public BukkitClasses() {}
7374

74-
public static final Pattern UUID_PATTERN = Pattern.compile("(?i)[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}");
75-
7675
static {
77-
final boolean GET_ENTITY_METHOD_EXISTS = Skript.methodExists(Bukkit.class, "getEntity", UUID.class);
7876
Classes.registerClass(new ClassInfo<>(Entity.class, "entity")
7977
.user("entit(y|ies)")
8078
.name("Entity")
@@ -91,25 +89,10 @@ public BukkitClasses() {}
9189
.defaultExpression(new EventValueExpression<>(Entity.class))
9290
.parser(new Parser<Entity>() {
9391
@Override
94-
@Nullable
95-
public Entity parse(final String s, final ParseContext context) {
96-
UUID uuid;
97-
try {
98-
uuid = UUID.fromString(s);
99-
} catch (IllegalArgumentException iae) {
100-
return null;
101-
}
102-
if (GET_ENTITY_METHOD_EXISTS) {
103-
return Bukkit.getEntity(uuid);
104-
} else {
105-
for (World world : Bukkit.getWorlds()) {
106-
for (Entity entity : world.getEntities()) {
107-
if (entity.getUniqueId().equals(uuid)) {
108-
return entity;
109-
}
110-
}
111-
}
112-
}
92+
public @Nullable Entity parse(final String s, final ParseContext context) {
93+
if (Utils.isValidUUID(s))
94+
return Bukkit.getEntity(UUID.fromString(s));
95+
11396
return null;
11497
}
11598

@@ -643,8 +626,10 @@ public Player parse(String string, ParseContext context) {
643626
if (context == ParseContext.COMMAND || context == ParseContext.PARSE) {
644627
if (string.isEmpty())
645628
return null;
646-
if (UUID_PATTERN.matcher(string).matches())
629+
630+
if (Utils.isValidUUID(string))
647631
return Bukkit.getPlayer(UUID.fromString(string));
632+
648633
String name = string.toLowerCase(Locale.ENGLISH);
649634
int nameLength = name.length(); // caching
650635
List<Player> players = new ArrayList<>();
@@ -709,16 +694,11 @@ public String getDebugMessage(final Player p) {
709694
.after("string", "world")
710695
.parser(new Parser<OfflinePlayer>() {
711696
@Override
712-
@Nullable
713-
public OfflinePlayer parse(final String s, final ParseContext context) {
714-
if (context == ParseContext.COMMAND || context == ParseContext.PARSE) {
715-
if (UUID_PATTERN.matcher(s).matches())
716-
return Bukkit.getOfflinePlayer(UUID.fromString(s));
717-
else if (!SkriptConfig.playerNameRegexPattern.value().matcher(s).matches())
718-
return null;
697+
public @Nullable OfflinePlayer parse(final String s, final ParseContext context) {
698+
if (Utils.isValidUUID(s))
699+
return Bukkit.getOfflinePlayer(UUID.fromString(s));
700+
else if (SkriptConfig.playerNameRegexPattern.value().matcher(s).matches())
719701
return Bukkit.getOfflinePlayer(s);
720-
}
721-
assert false;
722702
return null;
723703
}
724704

@@ -1536,6 +1516,15 @@ public String toVariableNameString(EntitySnapshot snapshot) {
15361516
.description("Teleport Flags are settings to retain during a teleport.")
15371517
.requiredPlugins("Paper 1.19+")
15381518
.since("2.10"));
1519+
1520+
Classes.registerClass(new ClassInfo<>(Vehicle.class, "vehicle")
1521+
.user("vehicles?")
1522+
.name("Vehicle")
1523+
.description("Represents a vehicle.")
1524+
.since("2.10.2")
1525+
.changer(DefaultChangers.entityChanger)
1526+
);
1527+
15391528
}
15401529

15411530
}

src/main/java/ch/njol/skript/classes/data/DefaultComparators.java

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.skriptlang.skript.lang.comparator.Relation;
4646

4747
import java.util.Objects;
48+
import java.util.UUID;
4849

4950
@SuppressWarnings({"rawtypes"})
5051
public class DefaultComparators {
@@ -665,6 +666,10 @@ public Relation compare(EntitySnapshot snap1, EntitySnapshot snap2) {
665666
}
666667
});
667668
}
669+
670+
// UUID
671+
Comparators.registerComparator(UUID.class, UUID.class, (one, two) -> Relation.get(one.equals(two)));
672+
Comparators.registerComparator(UUID.class, String.class, (one, two) -> Relation.get(one.toString().equals(two)));
668673
}
669674

670675
}

src/main/java/ch/njol/skript/classes/data/DefaultConverters.java

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
import org.skriptlang.skript.lang.converter.Converters;
4040
import org.skriptlang.skript.lang.script.Script;
4141

42+
import java.util.UUID;
43+
4244
public class DefaultConverters {
4345

4446
public DefaultConverters() {}
@@ -277,6 +279,9 @@ public void setAmount(Number amount) {
277279
Converters.registerConverter(Script.class, Config.class, Script::getConfig);
278280
Converters.registerConverter(Config.class, Node.class, Config::getMainNode);
279281

282+
// UUID -> String
283+
Converters.registerConverter(UUID.class, String.class, UUID::toString);
284+
280285
// // Entity - String (UUID) // Very slow, thus disabled for now
281286
// Converters.registerConverter(String.class, Entity.class, new Converter<String, Entity>() {
282287
//

0 commit comments

Comments
 (0)