Skip to content

Commit 2490ddd

Browse files
Merge branch 'dev/feature' into dev/LiteralMultipleWarning
2 parents 3d0ca60 + a12ba1d commit 2490ddd

File tree

13 files changed

+84
-77
lines changed

13 files changed

+84
-77
lines changed

.github/pull_request_template.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
### Description
2-
<!--- Describe your changes here. --->
1+
### Problem
2+
<!--- Why is this PR necessary? What problems exist that needed solving? --->
3+
4+
5+
### Solution
6+
<!--- Explain how your solution fixes the problem and summarize the major code changes. --->
7+
8+
9+
### Testing Completed
10+
<!--- List test scripts/unit tests and any manual testing that was performed. If no test scripts or unit tests are present, explain why. --->
11+
12+
13+
### Supporting Information
14+
<!--- Any related information, todos, breaking changes, or outstanding issues can be described here --->
15+
316

417
---
5-
**Target Minecraft Versions:** any <!-- 'any' means all supported versions -->
6-
**Requirements:** none <!-- Required plugins, server software... -->
7-
**Related Issues:** none <!-- Links to related issues -->
18+
**Completes:** none <!-- Links to issues or discussions that should be completed when this PR is merged. -->
19+
**Related:** none <!-- Links to issues or discussions with related information -->

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ allprojects {
2727
dependencies {
2828
shadow group: 'io.papermc', name: 'paperlib', version: '1.0.8'
2929
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.1.0'
30-
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.4'
30+
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.4.0'
3131

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

src/main/java/ch/njol/skript/effects/EffExit.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
101101
debug(event, false);
102102
for (SectionExitHandler section : sectionsToExit)
103103
section.exit(event);
104-
if (outerSection == null)
104+
if (outerSection == null) // "stop trigger"
105105
return null;
106106
return outerSection instanceof LoopSection loopSection ? loopSection.getActualNext() : outerSection.getNext();
107107
}
@@ -113,11 +113,15 @@ protected void execute(Event event) {
113113

114114
@Override
115115
public @Nullable ExecutionIntent executionIntent() {
116+
if (outerSection == null)
117+
return ExecutionIntent.stopTrigger();
116118
return ExecutionIntent.stopSections(breakLevels);
117119
}
118120

119121
@Override
120122
public String toString(@Nullable Event event, boolean debug) {
123+
if (outerSection == null)
124+
return "stop trigger";
121125
return "stop " + breakLevels + " " + names[type];
122126
}
123127

src/main/java/ch/njol/skript/expressions/ExprNoDamageTicks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ch.njol.skript.expressions;
22

3-
import ch.njol.skript.Skript;
43
import ch.njol.skript.classes.Changer.ChangeMode;
54
import ch.njol.skript.doc.Description;
65
import ch.njol.skript.doc.Examples;
@@ -15,6 +14,7 @@
1514
import org.bukkit.entity.LivingEntity;
1615
import org.bukkit.event.Event;
1716
import org.jetbrains.annotations.Nullable;
17+
import org.skriptlang.skript.lang.script.ScriptWarning;
1818

1919
@Name("No Damage Ticks")
2020
@Description("The number of ticks that an entity is invulnerable to damage for.")
@@ -32,7 +32,7 @@ public class ExprNoDamageTicks extends SimplePropertyExpression<LivingEntity, Lo
3232

3333
@Override
3434
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
35-
Skript.warning("This expression is deprecated. Please use 'invulnerability time' instead of 'invulnerability ticks'.");
35+
ScriptWarning.printDeprecationWarning("This expression is deprecated. Please use 'invulnerability time' instead of 'invulnerability ticks'.");
3636
return super.init(expressions, matchedPattern, isDelayed, parseResult);
3737
}
3838

src/main/java/ch/njol/skript/util/LiteralUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public static <T> Expression<T> defendExpression(Expression<?> expr) {
5353
public static boolean hasUnparsedLiteral(Expression<?> expr) {
5454
if (expr instanceof UnparsedLiteral) {
5555
return true;
56-
} else if (expr instanceof ExpressionList) {
57-
return Stream.of(((ExpressionList) expr).getExpressions())
58-
.anyMatch(e -> e instanceof UnparsedLiteral);
56+
} else if (expr instanceof ExpressionList exprList) {
57+
return Stream.of(exprList.getExpressions())
58+
.anyMatch(LiteralUtils::hasUnparsedLiteral);
5959
}
6060
return false;
6161
}

src/main/resources/lang/default.lang

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ types:
26432643
worldborder: worldborder¦s @a
26442644
inventory: inventor¦y¦ies @an
26452645
player: player¦s @a
2646-
offlineplayer: offline player¦s @a
2646+
offlineplayer: offline player¦s @an
26472647
commandsender: command sender¦s @a
26482648
inventoryholder: inventory holder¦s @an
26492649
gamemode: gamemode¦s @a
@@ -2658,7 +2658,7 @@ types:
26582658
enchantment: enchantment¦s @an
26592659
damagecause: damage cause¦s @a
26602660
teleportcause: teleport cause¦s @a
2661-
inventoryaction: inventory action¦s @a
2661+
inventoryaction: inventory action¦s @an
26622662
clicktype: click type¦s @a
26632663
vector: vector¦s @a
26642664
inventorytype: inventory type¦s @an
@@ -2691,7 +2691,7 @@ types:
26912691
textalignment: text alignment¦s @a
26922692
itemdisplaytransform: item display transform¦s @an
26932693
minecrafttag: minecraft tag¦s @a
2694-
experiencecooldownchangereason: experience cooldown change reason¦s @a
2694+
experiencecooldownchangereason: experience cooldown change reason¦s @an
26952695
inputkey: input key¦s @an
26962696
villagertype: villager type¦s @a
26972697
villagerprofession: villager profession¦s @a
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
test "potion aliases" when minecraft version is not "1.9.4":
2-
# Disabled on 1.9 - see #2587
1+
test "potion aliases":
32
assert speed potion is not water bottle with "potion alias: speed"
43
assert strength potion is not water bottle with "potion alias: strength"
54
assert long strength potion is not water bottle with "potion alias: long strength"
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
test "time played":
22
set {_time} to time played of "Notch" parsed as offlineplayer
3-
if running minecraft "1.15":
4-
assert {_time} is equal to 0 seconds with "Notch hacked your server and built a dirt house on your server (time: %{_time}%)"
5-
else:
6-
assert {_time} is not set with "Played time of offline players are not supported but seems like Notch is a hacker! (time: %{_time}%)"
3+
assert {_time} is equal to 0 seconds with "Played time of offline players are not supported but seems like Notch is a hacker! (time: %{_time}%)"

src/test/skript/tests/regressions/6907-playsound entity method doesn't exist.sk

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test "invalid nested list throws exception":
2+
parse:
3+
set {_x} to any of (1, (1, (1, (abc))))
4+
assert last parse logs contain "Can't understand this expression: 'any of (1, (1, (1, (abc))))'"

0 commit comments

Comments
 (0)