Skip to content

Commit

Permalink
Merge pull request #7307 from SkriptLang/dev/feature
Browse files Browse the repository at this point in the history
Merge feature branch into master (before release).
  • Loading branch information
Moderocky authored Jan 15, 2025
2 parents 7b5a8a6 + b57cec9 commit 9e69c9c
Show file tree
Hide file tree
Showing 1,620 changed files with 45,671 additions and 32,766 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ body:
## Guidelines
Please make sure you are running the latest version of Skript on a supported server platform and version.
Try to make sure there are no issues of this same problem currently open either.
As of the release of Skript 2.10, the oldest supported version has been raised to 1.19.4.
Any issues created for versions older than 1.19.4 will not be looked into or fixed unless the issue persists on supported versions.
- type: textarea
attributes:
label: Skript/Server Version
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: 2
updates:
- package-ecosystem: "gitsubmodule"
target-branch: "dev/patch"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- package-ecosystem: "github-actions"
target-branch: "dev/patch"
directory: "/"
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/github-issues/issues-labeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: When labels are modified, run actions.

on:
issues:
types: [labeled]

jobs:
remove-good-first-issue-label:
if: ${{ github.event.label.name == 'completed' || github.event.label.name == 'PR available'}}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["good first issue"]
})
35 changes: 0 additions & 35 deletions .github/workflows/java-11-builds.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/java-17-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java 17 CI (MC 1.17-1.20.4)
name: Java 17 CI (MC 1.19.4-1.20.4)

on:
push:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/junit-11-builds.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/junit-17-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JUnit (MC 1.17-1.20.4)
name: JUnit (MC 1.19.4-1.20.4)

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "skript-aliases"]
path = skript-aliases
url = https://github.com/SkriptLang/skript-aliases
branch = minimized-aliases
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Skript requires **Spigot** to work. You heard it right, **CraftBukkit** does *no
**Paper**, which is a fork of Spigot, is recommended; it is required for some
parts of Skript to be available.

Skript supports only the **latest** patch versions of Minecraft 1.13+.
For example, this means that 1.16.5 is supported, but 1.16.4 is *not*.
Skript supports only the **latest** patch versions of Minecraft 1.19 and newer.
For example, this means that 1.19.4 is supported, but 1.19.3 is *not*.
Testing with all old patch versions is not feasible for us.

Minecraft 1.12 and earlier are not, and will not be supported. New Minecraft
Expand Down Expand Up @@ -77,15 +77,14 @@ Skript has some tests written in Skript. Running them requires a Minecraft
server, but our build script will create one for you. Running the tests is easy:

```
./gradlew (quickTest|skriptTest|skriptTestJava11|skriptTestJava17|skriptTestJava21)
./gradlew (quickTest|skriptTest|skriptTestJava17|skriptTestJava21)
```

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

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

Expand Down
25 changes: 15 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ dependencies {
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.3-R0.1-SNAPSHOT'
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.4-R0.1-SNAPSHOT'
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT'

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

// Plugin hook libraries
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT', {
exclude group: 'org.bukkit', module: 'bukkit'
}
implementation group: 'net.milkbowl.vault', name: 'Vault', version: '1.7.3', {
exclude group: 'org.bstats', module: 'bstats-bukkit'
exclude group: 'org.bukkit', module: 'bukkit'
}

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

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

def java21 = 21
def java17 = 17
def java11 = 11

def latestEnv = 'java21/paper-1.21.3.json'
def latestEnv = 'java21/paper-1.21.4.json'
def latestJava = java21
def oldestJava = java11
def oldestJava = java17

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

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

// Build flavor configurations
Expand Down
5 changes: 2 additions & 3 deletions code-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ Your comments should look something like these:
## Language Features

### Compatibility
[//]: # (To be updated for 2.10 for Java 17)
* Contributions should maintain Java 11 source/binary compatibility, even though compiling Skript requires Java 21
- Users must not need JRE newer than version 11
* Contributions should maintain Java 17 source/binary compatibility, even though compiling Skript requires Java 21
- Users must not need JRE newer than version 17
* Versions up to and including Java 21 should work too
- Please avoid using unsafe reflection
* It is recommended to make fields final, if they are effectively final
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.parallel=true

groupid=ch.njol
name=skript
version=2.9.5
version=2.10.0
jarName=Skript.jar
testEnv=java21/paper-1.21.3
testEnv=java21/paper-1.21.4
testEnvJavaVersion=21
2 changes: 1 addition & 1 deletion skript-aliases
89 changes: 89 additions & 0 deletions src/main/java/ch/njol/skript/ModernSkriptBridge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package ch.njol.skript;

import org.jetbrains.annotations.Unmodifiable;
import org.skriptlang.skript.Skript;
import org.skriptlang.skript.addon.SkriptAddon;
import org.skriptlang.skript.localization.Localizer;
import org.skriptlang.skript.registration.SyntaxRegistry;
import org.skriptlang.skript.util.Registry;

import java.util.Collection;
import java.util.function.Supplier;

/**
* Bridge for interacting with the modern API classes from {@link org.skriptlang.skript}.
*/
final class ModernSkriptBridge {

private ModernSkriptBridge() { }

/**
* Similar to {@link Skript#unmodifiableView()}, but permits addon registration.
*/
public static final class SpecialUnmodifiableSkript implements Skript {

private final Skript skript;
private final Skript unmodifiableSkript;

public SpecialUnmodifiableSkript(Skript skript) {
this.skript = skript;
this.unmodifiableSkript = skript.unmodifiableView();
}

@Override
public SkriptAddon registerAddon(Class<?> source, String name) {
return skript.registerAddon(source, name);
}

@Override
public @Unmodifiable Collection<SkriptAddon> addons() {
return unmodifiableSkript.addons();
}

@Override
public Class<?> source() {
return unmodifiableSkript.source();
}

@Override
public String name() {
return unmodifiableSkript.name();
}

@Override
public <R extends Registry<?>> void storeRegistry(Class<R> registryClass, R registry) {
unmodifiableSkript.storeRegistry(registryClass, registry);
}

@Override
public void removeRegistry(Class<? extends Registry<?>> registryClass) {
unmodifiableSkript.removeRegistry(registryClass);
}

@Override
public boolean hasRegistry(Class<? extends Registry<?>> registryClass) {
return unmodifiableSkript.hasRegistry(registryClass);
}

@Override
public <R extends Registry<?>> R registry(Class<R> registryClass) {
return unmodifiableSkript.registry(registryClass);
}

@Override
public <R extends Registry<?>> R registry(Class<R> registryClass, Supplier<R> putIfAbsent) {
return unmodifiableSkript.registry(registryClass, putIfAbsent);
}

@Override
public SyntaxRegistry syntaxRegistry() {
return unmodifiableSkript.syntaxRegistry();
}

@Override
public Localizer localizer() {
return unmodifiableSkript.localizer();
}
}

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

import java.io.IOException;
Expand Down
Loading

0 comments on commit 9e69c9c

Please sign in to comment.