Ayfri / Kore

A Kotlin library to generate Datapacks for Minecraft Java.
https://kore.ayfri.com
GNU General Public License v3.0
73 stars 3 forks source link

[FEATURE] Allow definining multiple selectors of the same type #81

Closed Aeltumn closed 1 month ago

Aeltumn commented 2 months ago

What module does this feature apply to?

DSL

Feature description

I looked through the code and couldn't find this as a feature, but I'm trying to replicate a command in a datapack that goes:

/execute as @a[tag=!foo,tag=!bar,tag=!baz] run say test

But it appears that SelectorNbtData only lets you define one requirement per type. Vanilla simply parses all predicates in a row and adds them to a shared big predicate, so it allows repeating types. It does store whether a specific type appears at all for optimization reasons, but it lets you repeat them too.

My issue is not duplicated

Ayfri commented 2 months ago

Yes, that's a limitation I made way back when I started Kore, but now I know I should remove it, but that will be a breaking change without no doubt. I could maybe one day experiment with the assignment operator but that is a way harder and complex way than changing all the fields to be lists. I'll investigate what syntax should the user use, but it will be released in a second version of 1.20.5-pre1 (the first will only contain the important bug fixes).

Ayfri commented 1 month ago

image This will be available in the next release !