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

Create SectionExitHandler interface #6349

Merged

Conversation

takejohn
Copy link

@takejohn takejohn commented Jan 20, 2024

Description

  • Add an interface SectionExitHandler, having one method exit(Event).
  • Change LoopSection to implement this.
  • Change the 'exit' and 'return' effects to check if the enclosing nodes are SectionExitHandlers instead of checking for LoopSections.

This PR enables addons to add sections which don't need to hold loop counters doing something when exited.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jan 20, 2024
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.

Looks like a nice change to me!

Oh, one thing, please change the star import back to the individual imports.

@APickledWalrus
Copy link
Member

I'm not sure about the name. What do you think about something like ExitableSection

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.

Nice change

src/main/java/ch/njol/skript/lang/ExitHandlingSection.java Outdated Show resolved Hide resolved
@takejohn takejohn changed the title Create ExitHandlingSection interface Create SectionExitHandler interface Jan 20, 2024
@sovdeeth sovdeeth added the 2.9 Targeting a 2.9.X version release label Feb 2, 2024
@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Feb 17, 2024
@APickledWalrus APickledWalrus merged commit f603e9d into SkriptLang:dev/feature Mar 9, 2024
4 checks passed
@APickledWalrus
Copy link
Member

Thanks for this!

@takejohn takejohn deleted the feature/section-exit-handler branch March 10, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants