-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Add event values to docs #7501
base: dev/feature
Are you sure you want to change the base?
Add event values to docs #7501
Conversation
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.
QUICK.. SHIP IT!
Also, I'm pretty sure there is an issue or 2 you could link to this.
for (Class<? extends Event> event : allEventValues.keySet()) { | ||
if (!event.isAssignableFrom(supportedEvent)) | ||
continue; | ||
|
||
Collection<EventValueInfo<?, ?>> eventValueInfos = allEventValues.get(event); | ||
|
||
for (EventValueInfo<?, ?> eventValueInfo : eventValueInfos) { | ||
Class<?>[] excludes = eventValueInfo.excludes(); | ||
if (excludes != null && Set.of(excludes).contains(event)) | ||
continue; | ||
|
||
ClassInfo<?> exactClassInfo = Classes.getExactClassInfo(eventValueInfo.c()); | ||
if (exactClassInfo == null) | ||
continue; | ||
|
||
eventValues.add("event-%s".formatted(exactClassInfo.getName())); | ||
} | ||
} |
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.
I'm not 100% sure this accurately shows every event-value available, but I think it's guaranteed to show all the reliable event-values. You can see EventValues#getEventValueConverters for more details
Description
Adds all supported event values of an event to the docs. This includes a check for parent events. Requires SkriptLang/skript-docs#68.
Before
After
Target Minecraft Versions: any
Requirements: none
Related Issues: none