Skip to content

Commit 0ce985e

Browse files
authored
Merge branch 'dev/feature' into feature/sound-seed
2 parents cc0c22b + 28fbc6c commit 0ce985e

File tree

142 files changed

+3984
-1337
lines changed

Some content is hidden

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

142 files changed

+3984
-1337
lines changed

.github/workflows/archive-docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Archive documentation
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
archive-docs:
10+
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
11+
needs: release-docs
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Configure workflow
15+
id: configuration
16+
run: |
17+
echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
18+
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/archives/${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
19+
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
20+
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
21+
- name: Checkout Skript
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
path: skript
26+
- name: Setup documentation environment
27+
uses: ./skript/.github/workflows/docs/setup-docs
28+
with:
29+
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
30+
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
31+
- name: Generate documentation
32+
uses: ./skript/.github/workflows/docs/generate-docs
33+
with:
34+
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
35+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
36+
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
37+
is_release: true
38+
generate_javadocs: true
39+
- name: Push archive documentation
40+
uses: ./skript/.github/workflows/docs/push-docs
41+
with:
42+
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
43+
git_name: Archive Docs Bot
44+
git_email: archivedocs@skriptlang.org
45+
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} archive docs"

.github/workflows/docs/generate-docs/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ runs:
6969
7070
cd $SKRIPT_REPO_DIR
7171
if [[ "${IS_RELEASE}" == "true" ]]; then
72-
./gradlew genReleaseDocs releaseJavadoc
72+
./gradlew genReleaseDocs javadoc
7373
elif [[ "${GENERATE_JAVADOCS}" == "true" ]]; then
7474
./gradlew genNightlyDocs javadoc
7575
else
7676
./gradlew genNightlyDocs
7777
fi
7878
7979
if [ -d "${DOCS_OUTPUT_DIR}" ]; then
80-
if [[ "${GENERATE_JAVADOCS}" == "true" ]]; then
80+
if [[ "${GENERATE_JAVADOCS}" == "true" ]] || [[ "${IS_RELEASE}" == "true" ]] ; then
8181
mkdir -p "${SKRIPT_DOCS_OUTPUT_DIR}/javadocs" && cp -a "./build/docs/javadoc/." "$_"
8282
fi
8383

.github/workflows/java-8-builds.yml renamed to .github/workflows/java-11-builds.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java 8 CI (MC 1.13-1.16)
1+
name: Java 11 CI (MC 1.13-1.16)
22

33
on:
44
push:
@@ -26,7 +26,7 @@ jobs:
2626
- name: Grant execute permission for gradlew
2727
run: chmod +x gradlew
2828
- name: Build Skript and run test scripts
29-
run: ./gradlew clean skriptTestJava8
29+
run: ./gradlew clean skriptTestJava11
3030
- name: Upload Nightly Build
3131
uses: actions/upload-artifact@v4
3232
if: success()

.github/workflows/junit-8-builds.yml renamed to .github/workflows/junit-11-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- name: Grant execute permission for gradlew
2727
run: chmod +x gradlew
2828
- name: Build Skript and run JUnit
29-
run: ./gradlew clean JUnitJava8
29+
run: ./gradlew clean JUnitJava11

.github/workflows/release-docs.yml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Release documentation
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
67

78
jobs:
89
release-docs:
@@ -33,6 +34,7 @@ jobs:
3334
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
3435
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
3536
is_release: true
37+
generate_javadocs: true
3638
cleanup_pattern: "!(nightly|archives|templates)"
3739
- name: Push release documentation
3840
uses: ./skript/.github/workflows/docs/push-docs
@@ -41,40 +43,3 @@ jobs:
4143
git_name: Release Docs Bot
4244
git_email: releasedocs@skriptlang.org
4345
git_commit_message: "Update release docs to ${{ steps.configuration.outputs.BRANCH_NAME }}"
44-
45-
archive-docs:
46-
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
47-
needs: release-docs
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: Configure workflow
51-
id: configuration
52-
run: |
53-
echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
54-
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/archives/${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
55-
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
56-
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
57-
- name: Checkout Skript
58-
uses: actions/checkout@v4
59-
with:
60-
submodules: recursive
61-
path: skript
62-
- name: Setup documentation environment
63-
uses: ./skript/.github/workflows/docs/setup-docs
64-
with:
65-
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
66-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
67-
- name: Generate documentation
68-
uses: ./skript/.github/workflows/docs/generate-docs
69-
with:
70-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
71-
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
72-
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
73-
is_release: true
74-
- name: Push archive documentation
75-
uses: ./skript/.github/workflows/docs/push-docs
76-
with:
77-
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
78-
git_name: Archive Docs Bot
79-
git_email: archivedocs@skriptlang.org
80-
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} archive docs"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Skript requires **Spigot** to work. You heard it right, **CraftBukkit** does *no
1616
**Paper**, which is a fork of Spigot, is recommended; it is required for some
1717
parts of Skript to be available.
1818

19-
Skript supports only the **latest** patch versions of Minecraft 1.9+.
19+
Skript supports only the **latest** patch versions of Minecraft 1.13+.
2020
For example, this means that 1.16.5 is supported, but 1.16.4 is *not*.
2121
Testing with all old patch versions is not feasible for us.
2222

23-
Minecraft 1.8 and earlier are not, and will not be supported. New Minecraft
23+
Minecraft 1.12 and earlier are not, and will not be supported. New Minecraft
2424
versions will be supported as soon as possible.
2525

2626
## Download
@@ -77,15 +77,15 @@ Skript has some tests written in Skript. Running them requires a Minecraft
7777
server, but our build script will create one for you. Running the tests is easy:
7878

7979
```
80-
./gradlew (quickTest|skriptTest|skriptTestJava8|skriptTestJava17|skriptTestJava21)
80+
./gradlew (quickTest|skriptTest|skriptTestJava11|skriptTestJava17|skriptTestJava21)
8181
```
8282

8383
<code>quickTest</code> runs the test suite on newest supported server version.
8484
<code>skriptTestJava21</code> (1.20.6+) runs the tests on Java 21 supported versions.
8585
<code>skriptTestJava17</code> (1.17-1.20.4) runs the tests on Java 17 supported versions.
86-
<code>skriptTestJava8</code> (1.13-1.16) runs the tests on Java 8 supported versions.
86+
<code>skriptTestJava11</code> (1.13-1.16) runs the tests on Java 11 supported versions.
8787
<code>skriptTest</code> runs the tests on all versions.
88-
That is, it runs skriptTestJava8, skriptTestJava17, and skriptTestJava21.
88+
That is, it runs skriptTestJava11, skriptTestJava17, and skriptTestJava21.
8989

9090
By running the tests, you agree to Mojang's End User License Agreement.
9191

@@ -164,7 +164,7 @@ dependencies {
164164
}
165165
```
166166

167-
An example of the version tag would be ```dev37c```.
167+
An example of the version tag would be ```2.8.5```.
168168

169169
> Note: If Gradle isn't able to resolve Skript's dependencies, just [disable the resolution of transitive dependencies](https://docs.gradle.org/current/userguide/resolution_rules.html#sec:disabling_resolution_transitive_dependencies) for Skript in your project.
170170

build.gradle

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
3030
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'
3131

32-
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.6-R0.1-SNAPSHOT'
32+
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21-R0.1-SNAPSHOT'
3333
implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.700'
3434
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
3535
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT'
@@ -70,7 +70,7 @@ task build(overwrite: true, type: ShadowJar) {
7070
from sourceSets.main.output
7171
}
7272

73-
// Excludes the tests for the build task. Should be using junit, junitJava17, junitJava8, skriptTest, quickTest.
73+
// Excludes the tests for the build task. Should be using junit, junitJava17, junitJava11, skriptTest, quickTest.
7474
// We do not want tests to run for building. That's time consuming and annoying. Especially in development.
7575
test {
7676
exclude '**/*'
@@ -140,15 +140,6 @@ publishing {
140140
}
141141
}
142142

143-
task releaseJavadoc(type: Javadoc) {
144-
title = project.name + ' ' + project.property('version')
145-
source = sourceSets.main.allJava
146-
classpath = configurations.compileClasspath
147-
options.encoding = 'UTF-8'
148-
// currently our javadoc has a lot of errors, so we need to suppress the linter
149-
options.addStringOption('Xdoclint:none', '-quiet')
150-
}
151-
152143
// Task to check that test scripts are named correctly
153144
tasks.register('testNaming') {
154145
doLast {
@@ -188,7 +179,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
188179
if (junit) {
189180
artifact += 'Skript-JUnit.jar'
190181
} else if (releaseDocs) {
191-
artifact += 'Skript-github.jar'
182+
artifact += 'Skript-' + version + '.jar'
192183
} else {
193184
artifact += 'Skript-nightly.jar'
194185
}
@@ -233,7 +224,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
233224
if (!gradle.taskGraph.hasTask(":tasks") && !gradle.startParameter.dryRun && modifiers.contains(Modifiers.PROFILE)) {
234225
if (!project.hasProperty('profiler'))
235226
throw new MissingPropertyException('Add parameter -Pprofiler=<path to profiler>', 'profiler', String.class)
236-
227+
237228
args += '-agentpath:' + project.property('profiler') + '=port=8849,nowait'
238229
}
239230
}
@@ -242,11 +233,11 @@ void createTestTask(String name, String desc, String environments, int javaVersi
242233

243234
def java21 = 21
244235
def java17 = 17
245-
def java8 = 8
236+
def java11 = 11
246237

247-
def latestEnv = 'java21/paper-1.20.6.json'
238+
def latestEnv = 'java21/paper-1.21.0.json'
248239
def latestJava = java21
249-
def oldestJava = java8
240+
def oldestJava = java11
250241

251242
def latestJUnitEnv = 'java17/paper-1.20.4.json'
252243
def latestJUnitJava = java17
@@ -269,25 +260,25 @@ int envJava = project.property('testEnvJavaVersion') == null ? latestJava : Inte
269260
createTestTask('quickTest', 'Runs tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0)
270261
createTestTask('skriptTestJava21', 'Runs tests on all Java 21 environments.', environments + 'java21', java21, 0)
271262
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', java17, 0)
272-
createTestTask('skriptTestJava8', 'Runs tests on all Java 8 environments.', environments + 'java8', java8, 0)
263+
createTestTask('skriptTestJava11', 'Runs tests on all Java 11 environments.', environments + 'java11', java11, 0)
273264
createTestTask('skriptTestDev', 'Runs testing server and uses \'system.in\' for command input, stop server to finish.', environments + env, envJava, 0, Modifiers.DEV_MODE, Modifiers.DEBUG)
274265
createTestTask('skriptProfile', 'Starts the testing server with JProfiler support.', environments + latestEnv, latestJava, -1, Modifiers.PROFILE)
275266
createTestTask('genNightlyDocs', 'Generates the Skript documentation website html files.', environments + env, envJava, 0, Modifiers.GEN_NIGHTLY_DOCS)
276267
createTestTask('genReleaseDocs', 'Generates the Skript documentation website html files for a release.', environments + env, envJava, 0, Modifiers.GEN_RELEASE_DOCS)
277268
tasks.register('skriptTest') {
278269
description = 'Runs tests on all environments.'
279-
dependsOn skriptTestJava8, skriptTestJava17, skriptTestJava21
270+
dependsOn skriptTestJava11, skriptTestJava17, skriptTestJava21
280271
}
281272

282273
createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestJUnitEnv, latestJUnitJava, 0, Modifiers.JUNIT)
283274
// Disabled as EasyMock 5.2.0 is required for Java 21 support
284275
// However, we are currently using 5.0.1 (see https://github.com/SkriptLang/Skript/pull/6204#discussion_r1405302009)
285276
//createTestTask('JUnitJava21', 'Runs JUnit tests on all Java 21 environments.', environments + 'java21', java21, 0, Modifiers.JUNIT)
286277
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', java17, 0, Modifiers.JUNIT)
287-
createTestTask('JUnitJava8', 'Runs JUnit tests on all Java 8 environments.', environments + 'java8', java8, 0, Modifiers.JUNIT)
278+
createTestTask('JUnitJava11', 'Runs JUnit tests on all Java 11 environments.', environments + 'java11', java11, 0, Modifiers.JUNIT)
288279
tasks.register('JUnit') {
289280
description = 'Runs JUnit tests on all environments.'
290-
dependsOn JUnitJava8, JUnitJava17//, JUnitJava21
281+
dependsOn JUnitJava11, JUnitJava17//, JUnitJava21
291282
}
292283

293284
// Build flavor configurations
@@ -367,7 +358,7 @@ task nightlyResources(type: ProcessResources) {
367358
'today' : '' + LocalTime.now(),
368359
'release-flavor' : 'skriptlang-nightly', // SkriptLang build, automatically done by CI
369360
'release-channel' : 'prerelease', // No update checking, but these are VERY unstable
370-
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No autoupdates for now
361+
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No auto updates for now
371362
'release-source' : '',
372363
'release-download': 'null'
373364
]
@@ -389,8 +380,8 @@ task nightlyRelease(type: ShadowJar) {
389380
}
390381

391382
javadoc {
392-
dependsOn nightlyResources
393-
383+
mustRunAfter(tasks.withType(ProcessResources))
384+
title = 'Skript ' + project.property('version')
394385
source = sourceSets.main.allJava
395386

396387
exclude("ch/njol/skript/conditions/**")
@@ -403,10 +394,9 @@ javadoc {
403394
exclude("ch/njol/skript/lang/function/ExprFunctionCall.java")
404395
exclude("ch/njol/skript/hooks/**")
405396
exclude("ch/njol/skript/test/**")
406-
397+
407398
classpath = configurations.compileClasspath + sourceSets.main.output
408399
options.encoding = 'UTF-8'
409400
// currently our javadoc has a lot of errors, so we need to suppress the linter
410401
options.addStringOption('Xdoclint:none', '-quiet')
411402
}
412-

code-conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Your comments should look something like these:
194194
## Language Features
195195

196196
### Compatibility
197-
[//]: # (To be updated after feature/2.9 for Java 17)
197+
[//]: # (To be updated for 2.10 for Java 17)
198198
* Contributions should maintain Java 11 source/binary compatibility, even though compiling Skript requires Java 21
199199
- Users must not need JRE newer than version 11
200200
* Versions up to and including Java 21 should work too

gradle.properties

Lines changed: 2 additions & 2 deletions
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.8.6
8+
version=2.8.7
99
jarName=Skript.jar
10-
testEnv=java21/paper-1.20.6
10+
testEnv=java21/paper-1.21.0
1111
testEnvJavaVersion=21

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,17 @@ protected void afterErrors() {
752752
TestTracker.JUnitTestFailed(test, message);
753753
Skript.exception(failure.getException(), "JUnit test '" + failure.getTestHeader() + " failed.");
754754
});
755+
if (SkriptJUnitTest.class.isAssignableFrom(clazz))
756+
((SkriptJUnitTest) clazz.getConstructor().newInstance()).cleanup();
755757
SkriptJUnitTest.clearJUnitTest();
756758
}
757759
} catch (IOException e) {
758760
Skript.exception(e, "Failed to execute JUnit runtime tests.");
759761
} catch (ClassNotFoundException e) {
760762
// Should be the Skript test jar gradle task.
761763
assert false : "Class 'ch.njol.skript.variables.FlatFileStorageTest' was not found.";
764+
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
765+
Skript.exception(e, "Failed to initalize test JUnit classes.");
762766
}
763767
if (ignored > 0)
764768
Skript.warning("There were " + ignored + " ignored test cases! This can mean they are not properly setup in order in that class!");

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ public static String formatDate(final long timestamp) {
170170
}
171171
});
172172

173+
/**
174+
* Determines whether `on &lt;event&gt;` will be triggered by cancelled events or not.
175+
*/
176+
public static final Option<Boolean> listenCancelledByDefault = new Option<>("listen to cancelled events by default", false)
177+
.optional(true);
178+
173179

174180
/**
175181
* Maximum number of digits to display after the period for floats and doubles

0 commit comments

Comments
 (0)