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

Fix Doubles not being editable in the game-rule menu #3397

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ public boolean validate(String value) {
try {
final double d = Double.parseDouble(value);

return this.inBounds(d);
if (!this.inBounds(d)) {
return false;
}

this.value = d;
return true;
} catch (NumberFormatException ignored) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
public interface ValidateableRule {
/**
* Validates if a rule can accept the input.
* If valid, the input will be set as the rule's value.
*
* @param value the value to validate
* @return true if the value can be accepted.
* @return true if the value was accepted.
*/
boolean validate(String value);
}
Loading