-
-
Notifications
You must be signed in to change notification settings - Fork 371
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 Change Modes
to expressions in docs
#5687
Conversation
- Enhancements: Pre-Compile some regex patterns - Enhancement: Removed some duplicated null checks - Ignore Skript errors in getAcceptedChangeModes method
acceptedChangeModes = Arrays.stream(annotation.value()).toList(); | ||
} else { | ||
try { | ||
acceptedChangeModes = ((SimpleExpression<?>) info.getElementClass().newInstance()).getAcceptedChangeModes().keySet().stream().toList(); |
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 am a little weary of this given that expressions really should be initialized before having anything done on them - this may very well lead to inaccurate results
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface AcceptedChangeModes { |
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.
what do you think about just taking in a string - might give developers more freedom for more complicated cases
for example, let's say we're annotating ExprName
@AcceptedChangeModes("set (only for display/tablist names)")
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 would prefer this approach over current solution for freedom and ease of implementation however, this means we have to add this annotation to all current expressions manually which I am okay with but just to keep in mind.
bd134d0
to
3f08853
Compare
Co-authored-by: Patrick Miller <[email protected]>
closing due to inactivity |
Description
Currently this only implements getting the ChangeMode but not the accepted data type until a good way for implementing that in annotation is suggested/found.
Preview
Target Minecraft Versions:
Requirements:
Related Issues: