-
-
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
Arithmetic Private Methods Changed to Public #7207
Arithmetic Private Methods Changed to Public #7207
Conversation
Please put a little more effort into writing your PR name/description: these are auto-exported in change history & difference logs and it won't be very clear when searching through the contribution history what "thingy" is or what this is "fixing" |
Make |
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 think making these public is not the right way for addon devs to accomplish this. if registration fails, a skriptapiexception is thrown and can be caught by the caller
I think it'd be nicer to know whether it will works or not prior to doing all the work to make the arithmetic. Do you foresee a reason that exposing these methods would be negative? |
The same (similar in practice) methods are public for developers. Exception handling is unnecessarily heavy when this exists as a safe option we can provide. I will merge this in for now, but we can revisit this practice across all registries where it exists. |
Yeah, but the problem is that this is exposing implementation details. The caller doesn't want to know whether an exact operation already exists, they want to know whether it is acceptable to register the operation. Calling If the intent is to allow addon devs to check if a registration is acceptable, I think we should add a method specifically intended for that instead of exposing the utility methods that power the existing check. |
Description
This PR aims to change the
exactOperationExists
method within theArithmetic
class allowing skript-addons to ensure an operation does or does not already exist if registered by another addon.Target Minecraft Versions: any
Requirements: none
Related Issues: #7206