-
-
Notifications
You must be signed in to change notification settings - Fork 406
Customizable Section #8110
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
Open
Absolutionism
wants to merge
23
commits into
SkriptLang:dev/feature
Choose a base branch
from
Absolutionism:dev/BuildableSection
base: dev/feature
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Customizable Section #8110
Absolutionism
wants to merge
23
commits into
SkriptLang:dev/feature
from
Absolutionism:dev/BuildableSection
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…eSection # Conflicts: # src/main/java/ch/njol/skript/lang/SkriptParser.java
Labeled as draft to get feedback from others on these changes, incase any of them are extensive changes. |
sovdeeth
requested changes
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't checked the code yet, just commenting on the syntax
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
With the introduction of
ExpressionSection
in Skript 2.10, a suggestion at the time was to make an item builder section. however there was no way to achieve such without some of the changes that are introduced in this PR. Though this broadens the usage to more than just items.Solution
Overview
This PR makes it possible to customize an object inside a section, allowing that object to be used as a default value and not require
of x
for the elements inside the section. This works by creating an object during#init
that includes the type being customized that is checked for and used within a default context. This makes it safer and easier to write expressions that rely on context, because the right type is already known and enforced.It also helps limit where default values can be used, instead of exposing all possible types through conversion, which could cause issues of confusion.
Adds
ExprSecCustomizable
This class allows the user to input any object that can contain/hold data and customize it in the section, using the respective expressions to the type being built. This does extensive checking and expression handling in
#init
ensuring that the provided expression can only be used as one type and to check the type is able to be customized.It is imperative that the type is determined during
#init
to allow successful parsing and usage of expressions in the section, as this class can be anything.Adds
SectionEvent
This class extends
Event
storing the object being used.Hopefully to be mainstreamed to all
ExpressionSection
s and/orEffectSection
s, but some of those classes require special handling, so the current state may not be applicable.This class connects
ExpressionSection
s toSectionValueExpression
Adds
ExprSectionExpression
Similar to
ExprEventExpression
, this class is only used forSectionValueExpression
Adds
CustomizableRegistry
This class allows registering classes that normally cannot be customized, such as
Enum
s orRegistries
, to be customized as another type. Example:InventoryType
toInventory
.Also includes disallowing classes/types.
Adds
DefaultCustomizables
Utility class for registering and disallowing types during the enabling process of
Skript
.Misc
EventValueExpression
for aBuilder
.Testing Completed
ExprSecCustomizable.sk
quickTest
Supporting Information
N/A
Completes: none
Related: none