Skip to content

Allow addons to use the %classinfo% value property expression.#7359

Merged
Moderocky merged 4 commits into
SkriptLang:dev/featurefrom
Moderocky:any-value
Jan 15, 2025
Merged

Allow addons to use the %classinfo% value property expression.#7359
Moderocky merged 4 commits into
SkriptLang:dev/featurefrom
Moderocky:any-value

Conversation

@Moderocky
Copy link
Copy Markdown
Member

Description

2.10 added an experimental %*classinfo% value property for config nodes.
I realised this is probably useful for things other than config nodes, particularly for addons that support stuff like data tags.

This adds an AnyValued type that things can extend (or register converters for!) that allows the %*classinfo% value property to be used in more places.

@Moderocky Moderocky changed the base branch from master to dev/feature January 2, 2025 18:59
@Moderocky Moderocky added the feature Pull request adding a new feature. label Jan 2, 2025
})
@Since("2.10")
public class ExprNodeValue extends SimplePropertyExpression<Node, Object> {
@Since("2.10 (Nodes), INSERT VERSION (Any)")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@Since("2.10 (Nodes), INSERT VERSION (Any)")
@Since("2.10 (nodes), INSERT VERSION (any)")

}

/**
*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
*

Comment on lines +23 to +24
@UnknownNullability
Type value();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@UnknownNullability
Type value();
@UnknownNullability Type value();

Comment thread src/main/java/ch/njol/skript/lang/util/common/AnyValued.java
@Moderocky Moderocky marked this pull request as ready for review January 15, 2025 10:16
@Moderocky Moderocky merged commit 469927a into SkriptLang:dev/feature Jan 15, 2025
erenkarakal pushed a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
…iptLang#7359)

* Add support for more value types.

* Use proper array types.

* Remove old node value class.

* Clean up some bad imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull request adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants