Skip to content

Event Value Registry#8326

Merged
APickledWalrus merged 44 commits intodev/featurefrom
feature/event-value-registry
Mar 30, 2026
Merged

Event Value Registry#8326
APickledWalrus merged 44 commits intodev/featurefrom
feature/event-value-registry

Conversation

@UnderscoreTud
Copy link
Copy Markdown
Member

@UnderscoreTud UnderscoreTud commented Dec 19, 2025

Problem

Event values are a mess. The main method to get an event value using the EventValues class is almost 100 lines long and super hard to follow along.
Event values don't support any changers apart from SET, which is fine most of the time, but if you want your event value to support other changers you'd have to register an entire expression for it.
Additionally, there is no way to register an event value with a custom identifier (i.e. event-<identifier>) without making it its own expression.

Solution

EventValueRegistry serves as a full replacement to the EventValues class with a more modern API similar to Skript's new registration API with the ability to register and unregister event values at runtime as well as cache resolved event values to avoid computing it again in the future.
A new EventValue class that represents an event value, which now supports custom identifiers, event validation and any combination of changers. An EventValue object can be constructed through EventValue.builder.

Testing Completed

A lot of the present tests utilize event-values in some way or another, and the EventValues.sk test covers a lot of cases.

Supporting Information

I tried my best to keep parity between the old EventValues and the new EventValueRegistry classes, so there shouldn't be any breaking changes, unless I missed some obscure cases.

Breaking Changes

This PR removes two register methods in EventValues that use the Getter class as a parameter, which have been deprecated and marked for removal since 2.10.
A check has been added to ensure no duplicate event values are registered.


Completes: none
Related: none
AI assistance: Junie was used to generate most of the javadocs for EventValue and EventValueRegistry with some minor tweaks

@UnderscoreTud UnderscoreTud marked this pull request as ready for review December 24, 2025 00:15
@UnderscoreTud UnderscoreTud requested review from a team as code owners December 24, 2025 00:15
@UnderscoreTud UnderscoreTud requested review from Pesekjak, TheMug06 and sovdeeth and removed request for a team December 24, 2025 00:15
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Dec 24, 2025
@UnderscoreTud UnderscoreTud added breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Dec 24, 2025
Copy link
Copy Markdown
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 great
wonderful work tud, especially for your 2nd ever contribution

Copy link
Copy Markdown
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Looking really good so far

@skriptlang-automation skriptlang-automation bot removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jan 30, 2026
Copy link
Copy Markdown
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Excellent work on this!

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.15 Releases Mar 20, 2026
@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 Mar 23, 2026
@APickledWalrus APickledWalrus linked an issue Mar 30, 2026 that may be closed by this pull request
1 task
@APickledWalrus APickledWalrus merged commit d2d8040 into dev/feature Mar 30, 2026
10 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.15 Releases Mar 30, 2026
@skriptlang-automation skriptlang-automation bot added completed The issue has been fully resolved and the change will be in the next Skript update. and removed feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something.

Projects

Status: Done - Awaiting Release

Development

Successfully merging this pull request may close these issues.

Multiple event values of the same type

4 participants