-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge patches into feature (before release). (#7306)
* Fix the REMOVE changer of variables (#7163) * Fix the REMOVE changer of variables * Fix wording * Fix tests * Update Variable.java --------- Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> * Fix Improperly Typed Array in ExprXOf (#7268) * Add boat data check to prevent error. (#7301) * Fix BlockIgniteEvent (#7252) Update BukkitEventValues.java Co-authored-by: Moderocky <admin@moderocky.com> * Fix expression conversion (#7165) * Fix expression conversion * Extract duplicate code into a separate helper method * improve conversion strategy * Add .sk to test file * Simplify conversion usage We need to use conversion whenever there are multiple return types. If the expression does not accept our supertype, then we can attempt to convert it, which will already handle safety checks for multiple return types * SimpleExpression: fix possible return type conversion This fixes SimpleExpression not converting possible return types that are not contained in the desired types array. For example, if an expression can return a Number or a String, and we want an Expression that is a Number or an World, it will now include converters for String->Number and String->World * Use safety checks of ConvertedExpression * Remove incorrect converter remake * Move logic from SimpleExpression to ConvertedExpression --------- Co-authored-by: APickledWalrus <apickledwalrus@gmail.com> Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com> Co-authored-by: Moderocky <admin@moderocky.com> --------- Co-authored-by: _tud <98935832+UnderscoreTud@users.noreply.github.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: kyoshuske <65446070+kyoshuske@users.noreply.github.com> Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
- Loading branch information
1 parent
b56d33d
commit c01fc90
Showing
10 changed files
with
63 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/test/skript/tests/regressions/6817-null of x incorrect type.sk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test "null of x incorrect type": | ||
# would cause an exception | ||
spawn {_null} of pig above {_null} |
6 changes: 6 additions & 0 deletions
6
src/test/skript/tests/regressions/7162-removing from variable skips duplicates.sk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test "removing from variables skips duplicates": | ||
set {_list::*} to 1, 1, 2, 3, 4, 5, 6 and 6 | ||
remove 1 and 1 from {_list::*} | ||
assert {_list::*} is 2, 3, 4, 5, 6 and 6 with "didn't remove all instances of 1 from the list" | ||
remove first 6 elements out of {_list::*} from {_list::*} | ||
assert {_list::*} is not set with "didn't remove all elements" |
13 changes: 13 additions & 0 deletions
13
src/test/skript/tests/regressions/7164-expressions sometimes dont convert.sk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
test "expressions sometimes dont convert": | ||
assert formatted ({_foo} + {_bar}) is not set with "formatting nothing shouldn't throw an error" | ||
|
||
set {_foo} to "test" | ||
assert formatted ({_foo} + {_bar}) is not set with "formatting string + none shouldn't throw an error" | ||
|
||
set {_foo} to 1 | ||
set {_bar} to 2 | ||
assert formatted ({_foo} + {_bar}) is not set with "formatting number + number shouldn't throw an error" | ||
|
||
set {_foo} to "foo" | ||
set {_bar} to "bar" | ||
assert formatted ({_foo} + {_bar}) is "foobar" with "formatting strings doesn't work" |