Skript
Skript copied to clipboard
Add list transformation expression and effect
Description
Adds transformation/mapping syntaxes for lists:
(transform|map) %~objects% (using|with) <.+>
%~objects% (transformed|mapped) (using|with) \\[<.+>\\]
%~objects% (transformed|mapped) (using|with) \\(<.+>\\)
The effect only works on variable lists, but allows the indices of the list to be retained (if the expression is singular).
The expression works on any list, but naturally cannot retain indices.
If the expression is plural, this acts like flatMap, where x,y,z transformed with (a, b)
will return a(x), b(x), a(y), b(y), a(z), b(z)
.
Also allows ExprFilter to use () as grouping markers as well as [].
I'm still not convinced on the syntax wording and would like opinions and alternatives!
(i know i touched ClassInfo but i'm not cleaning all of that up!)
Target Minecraft Versions: any Requirements: none Related Issues: closes #3573