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

Simple Structures #6551

Merged

Conversation

APickledWalrus
Copy link
Member

@APickledWalrus APickledWalrus commented Apr 11, 2024

Description

This PR adds support for registering Structure that do not have sections. That is, they are based on SimpleNodes rather than SectionNodes. They simply look like:

# no end-of-line colon below means it is simple!
do something cool

# this is a regular structure
command /foo:
  trigger:
    ...

A Structure may be registered this way using Skript#registerSimpleStructure.

An API change was required that makes EntryContainer nullable in Structure's init. This will not break any existing code as for non-simple Structures, it is guaranteed that EntryContainer is NotNull.

Structure#getEntryContainer has also been deprecated. This method's existence was previously justified for internal reasons, but those reasons no longer exist (design has improved), so neither will this method in the future. Developers are encouraged to save a reference to the entry container during initialization if they need it during the loading period.


Target Minecraft Versions: any
Requirements: none
Related Issues:

@APickledWalrus APickledWalrus added enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature Pull request adding a new feature. labels Apr 11, 2024
Copy link
Member

@Moderocky Moderocky left a comment

Choose a reason for hiding this comment

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

Having actually used this myself I can say it works 🤣

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.

Good work Pickle! LGTM 🚀

@AyhamAl-Ali AyhamAl-Ali added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Apr 11, 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.

looking good!

@Moderocky Moderocky merged commit 299daba into SkriptLang:dev/feature Apr 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature Pull request adding a new feature. 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.

4 participants