Skip to content

Commit 9e69c9c

Browse files
authored
Merge pull request #7307 from SkriptLang/dev/feature
Merge feature branch into master (before release).
2 parents 7b5a8a6 + b57cec9 commit 9e69c9c

File tree

1,620 files changed

+45671
-32766
lines changed

Some content is hidden

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

1,620 files changed

+45671
-32766
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ body:
77
## Guidelines
88
Please make sure you are running the latest version of Skript on a supported server platform and version.
99
Try to make sure there are no issues of this same problem currently open either.
10+
As of the release of Skript 2.10, the oldest supported version has been raised to 1.19.4.
11+
Any issues created for versions older than 1.19.4 will not be looked into or fixed unless the issue persists on supported versions.
1012
- type: textarea
1113
attributes:
1214
label: Skript/Server Version

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "gitsubmodule"
4+
target-branch: "dev/patch"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
labels:
9+
- "dependencies"
310
- package-ecosystem: "github-actions"
411
target-branch: "dev/patch"
512
directory: "/"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: When labels are modified, run actions.
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
jobs:
8+
remove-good-first-issue-label:
9+
if: ${{ github.event.label.name == 'completed' || github.event.label.name == 'PR available'}}
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- uses: actions/github-script@v6
15+
with:
16+
script: |
17+
github.rest.issues.removeLabel({
18+
issue_number: context.issue.number,
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
name: ["good first issue"]
22+
})

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

Lines changed: 0 additions & 35 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java 17 CI (MC 1.17-1.20.4)
1+
name: Java 17 CI (MC 1.19.4-1.20.4)
22

33
on:
44
push:

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: JUnit (MC 1.17-1.20.4)
1+
name: JUnit (MC 1.19.4-1.20.4)
22

33
on:
44
push:

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "skript-aliases"]
22
path = skript-aliases
33
url = https://github.com/SkriptLang/skript-aliases
4+
branch = minimized-aliases

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ 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.13+.
20-
For example, this means that 1.16.5 is supported, but 1.16.4 is *not*.
19+
Skript supports only the **latest** patch versions of Minecraft 1.19 and newer.
20+
For example, this means that 1.19.4 is supported, but 1.19.3 is *not*.
2121
Testing with all old patch versions is not feasible for us.
2222

2323
Minecraft 1.12 and earlier are not, and will not be supported. New Minecraft
@@ -77,15 +77,14 @@ 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|skriptTestJava11|skriptTestJava17|skriptTestJava21)
80+
./gradlew (quickTest|skriptTest|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.
85-
<code>skriptTestJava17</code> (1.17-1.20.4) runs the tests on Java 17 supported versions.
86-
<code>skriptTestJava11</code> (1.13-1.16) runs the tests on Java 11 supported versions.
85+
<code>skriptTestJava17</code> (1.19.4-1.20.4) runs the tests on Java 17 supported versions.
8786
<code>skriptTest</code> runs the tests on all versions.
88-
That is, it runs skriptTestJava11, skriptTestJava17, and skriptTestJava21.
87+
That is, it runs skriptTestJava17, and skriptTestJava21.
8988

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

build.gradle

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

33-
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.3-R0.1-SNAPSHOT'
33+
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'
35-
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT'
35+
36+
// bundled with Minecraft 1.19.4+ for display entity transforms
37+
implementation group: 'org.joml', name: 'joml', version: '1.10.5'
38+
39+
// Plugin hook libraries
40+
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT', {
41+
exclude group: 'org.bukkit', module: 'bukkit'
42+
}
3643
implementation group: 'net.milkbowl.vault', name: 'Vault', version: '1.7.3', {
3744
exclude group: 'org.bstats', module: 'bstats-bukkit'
45+
exclude group: 'org.bukkit', module: 'bukkit'
3846
}
3947

4048
implementation fileTree(dir: 'lib', include: '*.jar')
@@ -75,7 +83,7 @@ task build(overwrite: true, type: ShadowJar) {
7583
from sourceSets.main.output
7684
}
7785

78-
// Excludes the tests for the build task. Should be using JUnitQuick, JUnitJava21, JUnitJava17, JUnitJava11, skriptTest, quickTest.
86+
// Excludes the tests for the build task. Should be using JUnitQuick, JUnitJava21, JUnitJava17, skriptTest, quickTest.
7987
// We do not want tests to run for building. That's time consuming and annoying. Especially in development.
8088
test {
8189
exclude '**/*'
@@ -238,11 +246,10 @@ void createTestTask(String name, String desc, String environments, int javaVersi
238246

239247
def java21 = 21
240248
def java17 = 17
241-
def java11 = 11
242249

243-
def latestEnv = 'java21/paper-1.21.3.json'
250+
def latestEnv = 'java21/paper-1.21.4.json'
244251
def latestJava = java21
245-
def oldestJava = java11
252+
def oldestJava = java17
246253

247254
def latestJUnitEnv = latestEnv
248255
def latestJUnitJava = latestJava
@@ -265,23 +272,21 @@ int envJava = project.property('testEnvJavaVersion') == null ? latestJava : Inte
265272
createTestTask('quickTest', 'Runs tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0)
266273
createTestTask('skriptTestJava21', 'Runs tests on all Java 21 environments.', environments + 'java21', java21, 0)
267274
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', java17, 0)
268-
createTestTask('skriptTestJava11', 'Runs tests on all Java 11 environments.', environments + 'java11', java11, 0)
269275
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)
270276
createTestTask('skriptProfile', 'Starts the testing server with JProfiler support.', environments + latestEnv, latestJava, -1, Modifiers.PROFILE)
271277
createTestTask('genNightlyDocs', 'Generates the Skript documentation website html files.', environments + env, envJava, 0, Modifiers.GEN_NIGHTLY_DOCS)
272278
createTestTask('genReleaseDocs', 'Generates the Skript documentation website html files for a release.', environments + env, envJava, 0, Modifiers.GEN_RELEASE_DOCS)
273279
tasks.register('skriptTest') {
274280
description = 'Runs tests on all environments.'
275-
dependsOn skriptTestJava11, skriptTestJava17, skriptTestJava21
281+
dependsOn skriptTestJava17, skriptTestJava21
276282
}
277283

278284
createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestJUnitEnv, latestJUnitJava, 0, Modifiers.JUNIT)
279285
createTestTask('JUnitJava21', 'Runs JUnit tests on all Java 21 environments.', environments + 'java21', java21, 0, Modifiers.JUNIT)
280286
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', java17, 0, Modifiers.JUNIT)
281-
createTestTask('JUnitJava11', 'Runs JUnit tests on all Java 11 environments.', environments + 'java11', java11, 0, Modifiers.JUNIT)
282287
tasks.register('JUnit') {
283288
description = 'Runs JUnit tests on all environments.'
284-
dependsOn JUnitJava11, JUnitJava17, JUnitJava21
289+
dependsOn JUnitJava17, JUnitJava21
285290
}
286291

287292
// Build flavor configurations

code-conventions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,8 @@ Your comments should look something like these:
195195
## Language Features
196196

197197
### Compatibility
198-
[//]: # (To be updated for 2.10 for Java 17)
199-
* Contributions should maintain Java 11 source/binary compatibility, even though compiling Skript requires Java 21
200-
- Users must not need JRE newer than version 11
198+
* Contributions should maintain Java 17 source/binary compatibility, even though compiling Skript requires Java 21
199+
- Users must not need JRE newer than version 17
201200
* Versions up to and including Java 21 should work too
202201
- Please avoid using unsafe reflection
203202
* It is recommended to make fields final, if they are effectively final

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.9.5
8+
version=2.10.0
99
jarName=Skript.jar
10-
testEnv=java21/paper-1.21.3
10+
testEnv=java21/paper-1.21.4
1111
testEnvJavaVersion=21
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
package ch.njol.skript;
2+
3+
import org.jetbrains.annotations.Unmodifiable;
4+
import org.skriptlang.skript.Skript;
5+
import org.skriptlang.skript.addon.SkriptAddon;
6+
import org.skriptlang.skript.localization.Localizer;
7+
import org.skriptlang.skript.registration.SyntaxRegistry;
8+
import org.skriptlang.skript.util.Registry;
9+
10+
import java.util.Collection;
11+
import java.util.function.Supplier;
12+
13+
/**
14+
* Bridge for interacting with the modern API classes from {@link org.skriptlang.skript}.
15+
*/
16+
final class ModernSkriptBridge {
17+
18+
private ModernSkriptBridge() { }
19+
20+
/**
21+
* Similar to {@link Skript#unmodifiableView()}, but permits addon registration.
22+
*/
23+
public static final class SpecialUnmodifiableSkript implements Skript {
24+
25+
private final Skript skript;
26+
private final Skript unmodifiableSkript;
27+
28+
public SpecialUnmodifiableSkript(Skript skript) {
29+
this.skript = skript;
30+
this.unmodifiableSkript = skript.unmodifiableView();
31+
}
32+
33+
@Override
34+
public SkriptAddon registerAddon(Class<?> source, String name) {
35+
return skript.registerAddon(source, name);
36+
}
37+
38+
@Override
39+
public @Unmodifiable Collection<SkriptAddon> addons() {
40+
return unmodifiableSkript.addons();
41+
}
42+
43+
@Override
44+
public Class<?> source() {
45+
return unmodifiableSkript.source();
46+
}
47+
48+
@Override
49+
public String name() {
50+
return unmodifiableSkript.name();
51+
}
52+
53+
@Override
54+
public <R extends Registry<?>> void storeRegistry(Class<R> registryClass, R registry) {
55+
unmodifiableSkript.storeRegistry(registryClass, registry);
56+
}
57+
58+
@Override
59+
public void removeRegistry(Class<? extends Registry<?>> registryClass) {
60+
unmodifiableSkript.removeRegistry(registryClass);
61+
}
62+
63+
@Override
64+
public boolean hasRegistry(Class<? extends Registry<?>> registryClass) {
65+
return unmodifiableSkript.hasRegistry(registryClass);
66+
}
67+
68+
@Override
69+
public <R extends Registry<?>> R registry(Class<R> registryClass) {
70+
return unmodifiableSkript.registry(registryClass);
71+
}
72+
73+
@Override
74+
public <R extends Registry<?>> R registry(Class<R> registryClass, Supplier<R> putIfAbsent) {
75+
return unmodifiableSkript.registry(registryClass, putIfAbsent);
76+
}
77+
78+
@Override
79+
public SyntaxRegistry syntaxRegistry() {
80+
return unmodifiableSkript.syntaxRegistry();
81+
}
82+
83+
@Override
84+
public Localizer localizer() {
85+
return unmodifiableSkript.localizer();
86+
}
87+
}
88+
89+
}

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
/**
2-
* This file is part of Skript.
3-
*
4-
* Skript is free software: you can redistribute it and/or modify
5-
* it under the terms of the GNU General Public License as published by
6-
* the Free Software Foundation, either version 3 of the License, or
7-
* (at your option) any later version.
8-
*
9-
* Skript is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with Skript. If not, see <http://www.gnu.org/licenses/>.
16-
*
17-
* Copyright Peter Güttinger, SkriptLang team and contributors
18-
*/
191
package ch.njol.skript;
202

213
import java.io.IOException;

0 commit comments

Comments
 (0)