Skip to content

Commit

Permalink
Merge master into dev/feature (#6211)
Browse files Browse the repository at this point in the history
* Fix ExprRandomNumber using a method from Java 17 (#6022)

* Fix changing remaining time of command cooldown (#6021)

Update ScriptCommand.java

Co-authored-by: Moderocky <[email protected]>

* Bump version to 2.7.1 (#5993)

Co-authored-by: Moderocky <[email protected]>

* fix 3 stray INSERT VERSIONs from 2.7.0 (#6027)

correct incorrect values

* Fix Documentation Actions on dev/patch (#6042)

* Tidy up parts of config class. (#6025)

* Add Release Model Document (#6041)

Add release model document

Co-authored-by: Ayham Al Ali <[email protected]>
Co-authored-by: Moderocky <[email protected]>

* (Cherry Pick) Fix cast throwing if existing variable for command storage exists (#5942) (#6026)

Fix cast throwing if existing variable for command storage exists (#5942)

* Fix cast throwing if existing variable for command storage exists

* Update src/main/java/ch/njol/skript/command/ScriptCommand.java



---------

Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: Ayham Al Ali <[email protected]>

* (Cherry Pick) Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978) (#6023)

Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978)

* Avoid NPE and clean up class

* Update ExprEntityAttribute.java

* Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java



* Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java

---------

Co-authored-by: sovdee <[email protected]>
Co-authored-by: Ayham Al Ali <[email protected]>

* Fix multiple aliases sections not working (#6050)

* Fix error when unloading a script with multiple variables sections (#6047)

* Returns the old 2.6.4 duplicate variables section behaviour.

* Add an error but i don't know what it's for

* Add lots of brackets to keep walrus happy :}}}

* Add load tracker to prevent multiple loading.

* Prevent variable data wipe, fix another bug

* Support IDEs from the dark ages that don't know what a star is and think it orbits the earth or something

* add a test

---------

Co-authored-by: APickledWalrus <[email protected]>

* Bump actions/checkout from 3 to 4 (#6029)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

* ⚒ Disable Javadocs generation for nightly docs & improvements (#6059)

* Let's see if I am good at GH actions 🤞

* ops!

* Use proper docs template reference when possible

* Disable nightly javadocs generation with an option

Each javadoc is ~50mb, which was causing the big size of the docs! while each docs generation is ~2mb only

* Fix building

* Revert pull changes

They are not what fixed the issue, probably the old PRs aren't syncing for some reason

* Update build.gradle

---------

Co-authored-by: Moderocky <[email protected]>

* Change the target branch of dependabot (#6063)

Update dependabot.yml

* ⚒ Fix stop all sounds NPE (#6067)

* Bump actions/checkout from 3 to 4 (#6069)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: LimeGlass <[email protected]>

* Bump org.gradle.toolchains.foojay-resolver-convention from 0.5.0 to 0.7.0 (#6070)

Bump org.gradle.toolchains.foojay-resolver-convention

Bumps org.gradle.toolchains.foojay-resolver-convention from 0.5.0 to 0.7.0.

---
updated-dependencies:
- dependency-name: org.gradle.toolchains.foojay-resolver-convention
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: LimeGlass <[email protected]>

* Bump org.easymock:easymock from 5.1.0 to 5.2.0 (#6071)

Bumps [org.easymock:easymock](https://github.com/easymock/easymock) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/easymock/easymock/releases)
- [Changelog](https://github.com/easymock/easymock/blob/master/ReleaseNotes.md)
- [Commits](easymock/easymock@easymock-5.1.0...easymock-5.2.0)

---
updated-dependencies:
- dependency-name: org.easymock:easymock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: LimeGlass <[email protected]>

* Bump io.papermc.paper:paper-api from 1.20.1-R0.1-SNAPSHOT to 1.20.2-R0.1-SNAPSHOT (#6072)

* Bump io.papermc.paper:paper-api

Bumps io.papermc.paper:paper-api from 1.20.1-R0.1-SNAPSHOT to 1.20.2-R0.1-SNAPSHOT.

---
updated-dependencies:
- dependency-name: io.papermc.paper:paper-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Apply 1.20.2 to the test runner

* Deprecate org.bukkit.util.Consumer usage in EntityData

* Adapt against the Java Consumer instead of Bukkit's

* Resolve existing method deprecation

* Adapt against the Java Consumer instead of Bukkit's

* Update developer note

* Result in reflection for Bukkit Consumer

* Resolve ThrownPotion Consumer

* Result in reflection for Bukkit Consumer

* Pretty else if

* Add common reflective spawn method.

* Use common spawn method in potion class.

* Remove old suppression!

* Whoops I forgot about the consumer

* Don't need reflection import anymore :)

* Thrown potion class

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: TheLimeGlass <[email protected]>
Co-authored-by: Moderocky <[email protected]>

* Pull request template defaults (#5665)

Update pull_request_template.md

* Fix EvtPlayerChunkEnter Comparison & Cleanup (#5965)

Initial

(cherry picked from commit 389c002)

Co-authored-by: Moderocky <[email protected]>

* Fixes EffSecSpawn not properly handling local variables created within the section (#6033)

Communicate local variables between consumer calls

thanks pickle

Co-authored-by: Moderocky <[email protected]>

* Remove PlayerPreprocessCommandEvent listener and clean up Commands (#5966)

* Remove PPCE listener and clean up Commands

* Apply suggestions from code review

Co-authored-by: LimeGlass <[email protected]>

* Update Commands.java

* we hate breaking changes

---------

Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: Moderocky <[email protected]>

* Clean up vector classes and fix a few bugs.

* More improvements

* Apply suggestions from code review

Co-authored-by: Ayham Al Ali <[email protected]>

* Budget Expansion

* Fix Logging Issues In ExpressionEntryData (#6081)

Fix duplicate logging

* Prepare For Release 2.7.1 (#6082)

* Update Minecraft wiki links to new domain (#6078)

* ⚒ Fix fake player count paper check error (#6090)

* Fix Command Help (#6080)

Fix issues and cleanup CommandHelp class

Co-authored-by: Moderocky <[email protected]>

* Bump net.kyori:adventure-text-serializer-bungeecord from 4.3.0 to 4.3.1 (#6084)

Bumps [net.kyori:adventure-text-serializer-bungeecord](https://github.com/KyoriPowered/adventure-platform) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](KyoriPowered/adventure-platform@v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-serializer-bungeecord
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ayham Al Ali <[email protected]>

* Fix unloading/reloading a directory in the scripts effect (#6106)

* Moved unloading to a common method.

* Accidental double space 😬

* Force UTF-8 encoding for Gradle daemon (#6103)

Co-authored-by: Moderocky <[email protected]>

* Corrected Javadocs name, title (#6038)

* Javadoc Title,Name

* Update .gitignore

Co-authored-by: LimeGlass <[email protected]>

---------

Co-authored-by: Ayham Al Ali <[email protected]>
Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: Moderocky <[email protected]>

* Rebase JUnit references fix for dev/patch (#6057)

* Fix options issue in functions (#6121)

* Fix command permission messages (2.7.1 issue) (#6126)

re-add permission handling during PPCE to get around spigot behavior.

* Fix stack overflow when stringifying block inventories. (#6117)

* Fix stack overflow when stringifying block inventories.

* Blanket catch until a better solution is found.

* Fix comparison of cyclical types (specifically comparing times) (#6128)

* Add cyclical type helper.

* Make time cyclical.

* Add special comparison for cyclical types.

* Add some tests.

* Fix floating point rounding error in loop N times (#6132)

Fix floating point error in loop X times.

* Fix Sorted List Expression (#6102)

* Fix ExprSortedList

* Update src/main/java/ch/njol/skript/expressions/ExprSortedList.java

Co-authored-by: LimeGlass <[email protected]>

* Fix test

Co-authored-by: Moderocky <[email protected]>

---------

Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: Moderocky <[email protected]>

* Fix colour codes being reset in reload message. (#6150)

Fix colour codes being reset.

* Fix ExprDurability's Changer (#6154)

* Fix ExprDurability's changer

* Change method name.

* Add simple test.

---------

Co-authored-by: Moderocky <[email protected]>

* Catch the exception when pushing entity by non finite vector (#5765)

* Fix issues with ExprDrops (#6130)

* refactor ExprDrops, fix bugs, add test

fixed setting drops to multiple items/experience values at once
fixed null values being left in drops after removing items
maintained behavior but behavior needs a big update

* small cleanup

* Fix JUnit test location

* import shenanigans

---------

Co-authored-by: Moderocky <[email protected]>

* Prepare For Release (2.7.2) (#6166)

* Prevent InventoryHolder -> X chaining (#6171)

* Prevent InventoryHolder -> X chaining

* Improve Location Comparison (#6205)

* Allow asynchronous SkriptEvent#check execution (#6201)

* Fix ExprSets conflicting (#6123)

* Prepare for Release (2.7.3) (#6208)

* Further corrections

* Fix NPE issue with drops in 1.20.2

* Update StructFunction.java

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: _tud <[email protected]>
Co-authored-by: sovdee <[email protected]>
Co-authored-by: Moderocky <[email protected]>
Co-authored-by: LimeGlass <[email protected]>
Co-authored-by: Ayham Al Ali <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: TheLimeGlass <[email protected]>
Co-authored-by: DelayedGaming <[email protected]>
Co-authored-by: Spongecade <[email protected]>
Co-authored-by: MihirKohli <[email protected]>
Co-authored-by: _tud <[email protected]>
Co-authored-by: 3meraldK <[email protected]>
  • Loading branch information
13 people authored Dec 17, 2023
1 parent da651a5 commit 09e8527
Show file tree
Hide file tree
Showing 84 changed files with 1,524 additions and 939 deletions.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<!--- Describe your changes here. --->

---
**Target Minecraft Versions:** <!-- 'any' means all supported versions -->
**Requirements:** <!-- Required plugins, Minecraft versions, server software... -->
**Related Issues:** <!-- Links to related issues -->
**Target Minecraft Versions:** any <!-- 'any' means all supported versions -->
**Requirements:** none <!-- Required plugins, server software... -->
**Related Issues:** none <!-- Links to related issues -->
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ allprojects {
dependencies {
shadow group: 'io.papermc', name: 'paperlib', version: '1.0.8'
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.0'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.1'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.1-R0.1-SNAPSHOT'
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.2-R0.1-SNAPSHOT'
implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.700'
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'
Expand Down Expand Up @@ -226,7 +226,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
main = 'ch.njol.skript.test.platform.PlatformMain'
args = [
'build/test_runners',
junit ? 'src/test/skript/tests/junit' : 'src/test/skript/tests',
junit ? 'src/test/skript/junit' : 'src/test/skript/tests',
'src/test/resources/runner_data',
environments,
modifiers.contains(Modifiers.DEV_MODE),
Expand All @@ -250,7 +250,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
}
}

def latestEnv = 'java17/paper-1.20.1.json'
def latestEnv = 'java17/paper-1.20.2.json'
def latestJava = 17
def oldestJava = 8

Expand Down Expand Up @@ -393,7 +393,7 @@ task nightlyRelease(type: ShadowJar) {

javadoc {
dependsOn nightlyResources

source = sourceSets.main.allJava

exclude("ch/njol/skript/conditions/**")
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Ensure encoding is consistent across systems.
org.gradle.jvmargs=-Xmx1G -Dfile.encoding=UTF-8
org.gradle.parallel=true

groupid=ch.njol
name=skript
version=2.8.0-dev
jarName=Skript.jar
testEnv=java17/paper-1.20.1
testEnv=java17/paper-1.20.2
testEnvJavaVersion=17
2 changes: 1 addition & 1 deletion skript-aliases
Submodule skript-aliases updated 1 files
+3 −1 decoration.sk
9 changes: 5 additions & 4 deletions src/main/java/ch/njol/skript/Skript.java
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ public void run() {
tainted = true;
try {
getAddonInstance().loadClasses("ch.njol.skript.test.runner");
if (TestMode.JUNIT)
getAddonInstance().loadClasses("org.skriptlang.skript.test.junit.registration");
} catch (IOException e) {
Skript.exception("Failed to load testing environment.");
Bukkit.getServer().shutdown();
Expand Down Expand Up @@ -684,7 +686,6 @@ protected void afterErrors() {
TestTracker.testFailed("exception was thrown during execution");
}
if (TestMode.JUNIT) {
SkriptLogger.setVerbosity(Verbosity.DEBUG);
info("Running all JUnit tests...");
long milliseconds = 0, tests = 0, fails = 0, ignored = 0, size = 0;
try {
Expand Down Expand Up @@ -712,7 +713,7 @@ protected void afterErrors() {
// If JUnit failures are present, add them to the TestTracker.
junit.getFailures().forEach(failure -> {
String message = failure.getMessage() == null ? "" : " " + failure.getMessage();
TestTracker.testFailed("'" + test + "': " + message);
TestTracker.JUnitTestFailed(test, message);
Skript.exception(failure.getException(), "JUnit test '" + failure.getTestHeader() + " failed.");
});
SkriptJUnitTest.clearJUnitTest();
Expand All @@ -734,7 +735,7 @@ protected void afterErrors() {
// Delay server shutdown to stop the server from crashing because the current tick takes a long time due to all the tests
Bukkit.getScheduler().runTaskLater(Skript.this, () -> {
if (TestMode.JUNIT && !EffObjectives.isJUnitComplete())
TestTracker.testFailed(EffObjectives.getFailedObjectivesString());
EffObjectives.fail();

info("Collecting results to " + TestMode.RESULTS_FILE);
String results = new Gson().toJson(TestTracker.collectResults());
Expand Down Expand Up @@ -1261,7 +1262,7 @@ public static boolean isAcceptRegistrations() {
}

public static void checkAcceptRegistrations() {
if (!isAcceptRegistrations())
if (!isAcceptRegistrations() && !Skript.testing())
throw new SkriptAPIException("Registration can only be done during plugin initialization");
}

Expand Down
18 changes: 9 additions & 9 deletions src/main/java/ch/njol/skript/SkriptEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ private static void check(Event event, EventPriority priority) {
boolean hasTrigger = false;
for (Trigger trigger : triggers) {
SkriptEvent triggerEvent = trigger.getEvent();
if (triggerEvent.getEventPriority() == priority && Boolean.TRUE.equals(Task.callSync(() -> triggerEvent.check(event)))) {
if (
triggerEvent.getEventPriority() == priority
&& triggerEvent.canExecuteAsynchronously() ? triggerEvent.check(event) : Boolean.TRUE.equals(Task.callSync(() -> triggerEvent.check(event)))
) {
hasTrigger = true;
break;
}
Expand All @@ -130,7 +133,7 @@ private static void check(Event event, EventPriority priority) {

logEventStart(event);
}

boolean isCancelled = event instanceof Cancellable && ((Cancellable) event).isCancelled() && !listenCancelled.contains(event.getClass());
boolean isResultDeny = !(event instanceof PlayerInteractEvent && (((PlayerInteractEvent) event).getAction() == Action.LEFT_CLICK_AIR || ((PlayerInteractEvent) event).getAction() == Action.RIGHT_CLICK_AIR) && ((PlayerInteractEvent) event).useItemInHand() != Result.DENY);

Expand All @@ -155,15 +158,12 @@ private static void check(Event event, EventPriority priority) {
};

if (trigger.getEvent().canExecuteAsynchronously()) {
// check should be performed on the main thread
if (Boolean.FALSE.equals(Task.callSync(() -> triggerEvent.check(event))))
continue;
execute.run();
if (triggerEvent.check(event))
execute.run();
} else { // Ensure main thread
Task.callSync(() -> {
if (!triggerEvent.check(event))
return null;
execute.run();
if (triggerEvent.check(event))
execute.run();
return null; // we don't care about a return value
});
}
Expand Down
Loading

0 comments on commit 09e8527

Please sign in to comment.