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

Add SectionContext #6058

Open
1 task done
TheLimeGlass opened this issue Sep 22, 2023 · 0 comments
Open
1 task done

Add SectionContext #6058

TheLimeGlass opened this issue Sep 22, 2023 · 0 comments
Assignees
Labels
2.8 Targeting a 2.8.X version release core task Tasks that may be handled only by the core developer team. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@TheLimeGlass
Copy link
Collaborator

TheLimeGlass commented Sep 22, 2023

Suggestion

Add SomeNameSectionContext so that syntaxes can use TriggerSection#getSectionContext(Example.class) similar to StructureData but for Sections

Why?

This way addons and Skript's own syntaxes don't need to register the trigger as it's own event context. Which when using loadCode with an event. The ParserInstance#getCurrentSection gets cleared because of delayed calling. A trigger can then load later, and when it loads later, the getCurrentSection will not reflect properly. So we clear it when the loadCode is set.

This solution makes it so that you won't need to change the event context, but rather just collect the data from the current section so that the section itself can then use that data after it calls the trigger.

Other

This is used for custom sections with custom expressions like in my EffSecPlaceStructure at #5222

place structure "minecraft:end_city" at player's location:
    set includes entities to false
    set integrity to 0.9
    set pallet to 2
    set rotation to clockwise 90
    set mirror to left to right

Currently SectionContext is a class that is used on Structures, so some other name would be needed or maybe that itself needs a rename.

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@TheLimeGlass TheLimeGlass added enhancement Feature request, an issue about something that could be improved, or a PR improving something. core task Tasks that may be handled only by the core developer team. 2.8 Targeting a 2.8.X version release labels Sep 22, 2023
@TheLimeGlass TheLimeGlass self-assigned this Sep 25, 2023
@TheLimeGlass TheLimeGlass added the priority: low Issues that are not harmful to the experience but are related to useful changes or additions. label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.8 Targeting a 2.8.X version release core task Tasks that may be handled only by the core developer team. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

2 participants