Skip to content
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

Unprivate Arithmetics#exactOperationExists method #7206

Open
1 task done
Fusezion opened this issue Nov 9, 2024 · 3 comments
Open
1 task done

Unprivate Arithmetics#exactOperationExists method #7206

Fusezion opened this issue Nov 9, 2024 · 3 comments
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. PR available Issues which have a yet-to-be merged PR resolving it priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@Fusezion
Copy link
Contributor

Fusezion commented Nov 9, 2024

Suggestion

Unprivate the exactOperationExists method on the Arithmetics class

Why?

Currently addons have no real way of checking if operations for arithmetic are currently registered making usage of the register unsafe

Other

Step to fix

private static boolean exactOperationExists(Operator operator, Class<?> leftClass, Class<?> rightClass) {
for (OperationInfo<?, ?, ?> info : getOperations_i(operator)) {
if (info.getLeft() == leftClass && info.getRight() == rightClass)
return true;
}
return false;
}

- private static boolean exactOperationExists(Operator operator, Class<?> leftClass, Class<?> rightClass) {
+ public static boolean exactOperationExists(Operator operator, Class<?> leftClass, Class<?> rightClass) {

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@Efnilite Efnilite added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels Nov 9, 2024
@Efnilite Efnilite added the PR available Issues which have a yet-to-be merged PR resolving it label Nov 9, 2024
@Pikachu920
Copy link
Member

Currently addons have no real way of checking if operations for arithmetic are currently registered making usage of the register unsafe

you can catch the skriptapiexception

@UnderscoreTud
Copy link
Member

I feel that's more of a workaround rather than an actual solution

@Pikachu920
Copy link
Member

I feel that's more of a workaround rather than an actual solution

hows that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. PR available Issues which have a yet-to-be merged PR resolving it priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

4 participants