Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure API Update #77

Merged
merged 7 commits into from Dec 27, 2023
Merged

Structure API Update #77

merged 7 commits into from Dec 27, 2023

Conversation

UnderscoreTud
Copy link
Member

@UnderscoreTud UnderscoreTud commented Oct 14, 2023

Convert code using SelfRegisteringSkriptEvent to use Structures and start moving classes into the new package (org.skriptlang.skript)

Fixes #75
Fixes #72
Fixes #69

@UnderscoreTud UnderscoreTud added the enhancement New feature or request label Oct 14, 2023
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my eyes glazed over halfway through the code but all my testing couldn't produce any bugs
so seems good for dev build testing

Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not yet taken too deep of look into the other custom syntax structures, but they have the same "issues" as StructCustomCondition

excellent work so far!

Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking pretty good

@envizar
Copy link

envizar commented Nov 5, 2023

Is there already a stable version with these changes?
New version of Hippo depends on skript-reflect with these changes

…structure

Fix custom syntax elements erroring if they don't have a 'parse' entry
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some final formatting suggestions. Excellent work! Next stop: merging :)

@rudde0
Copy link

rudde0 commented Nov 7, 2023

idk is it correct place or not but I want to mention that skript-reflects detects new ArrayList() as skript function and it throws The function 'ArrayList' does not exist. error.

import:
    java.util.ArrayList
    java.util.Collections
    java.util.Map$Entry
    ch.njol.skript.variables.Variables

# Example
#set {_topkillers::*} to the top (size of {Kills::*}) values of {Kills::*} as "&e@place. &a@index &7- &b@value"
expression replace values %strings% with %strings% in %string%:
    get:
        set {_string} to expression-3
        loop expressions-1:
            add 1 to {_index}
            replace all "%loop-value%" with "%{_index}th element of expressions-2%" in {_string}
        return {_string}
 
plural expression [the ](1¦(highest|top)|2¦(lowest|last)) %integer% values of %objects% [formatted ]as %string%:
    get:
        set {_list} to new ArrayList(Variables.getVariable(raw expressions-2.getName().toString(event), event, raw expressions-2.isLocal()).entrySet())
        ({_list}).sort(Entry.comparingByValue())
        if parse mark = 1:
            Collections.reverse({_list})
        loop ...{_list}:
            add 1 to {_index}
            set {_sorted::%{_index}%} to replace values "@place", "@index" and "@value" with "%{_index}%", "%loop-value.getKey()%" and "%loop-value.getValue()%" in expression-3
            {_index} = expression-1
            stop loop
        return {_sorted::*}

Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 🚀

@UnderscoreTud UnderscoreTud merged commit c73746f into skript-2.7 Dec 27, 2023
1 check passed
@UnderscoreTud UnderscoreTud deleted the structure-api-update branch December 27, 2023 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants