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

Conversation

Estecka
Copy link
Contributor

@Estecka Estecka commented Oct 29, 2023

Hi,

Currently, game-rules of type Double are impossible to edit using the "Edit Gamerules" screen on world creation; any change to those rules is discarded upon exiting the screen.

This is due to DoubleRule.validate not updating the rule's value when called by the DoubleRuleWidget. For other gamerule types, this is how their widget update their value.

I have tested the fix in this PR on 1.20.2 using the artifacts generated on my fork. However the issue dates from furher back; at least since 1.19.4 where I first identified the issue. If this is accepted, I'd be interested in a backport of this fix to that version.

@Technici4n
Copy link
Member

validate is a poor name for this method, unfortunately not changeable in the API. Could you at least update the javadoc of ValidateableRule to say that it should also set the value?

@Estecka
Copy link
Contributor Author

Estecka commented Oct 30, 2023

By the way, I noticed DoubleRule is the only one that implements ValidateableRule. Shouldn't BoundedInt implement it as well ?

@Technici4n
Copy link
Member

By the way, I noticed DoubleRule is the only one that implements ValidateableRule. Shouldn't BoundedInt implement it as well ?

It can't due to remapping (the method would not be available in production).

@Technici4n Technici4n requested a review from a team October 30, 2023 10:56
@liach liach added the bug Something isn't working label Oct 30, 2023
@modmuss50 modmuss50 added the merge me please Pull requests that are ready to merge label Oct 30, 2023
@modmuss50 modmuss50 merged commit a44e16a into FabricMC:1.20.2 Nov 2, 2023
5 checks passed
modmuss50 pushed a commit that referenced this pull request Nov 2, 2023
* Fix double gamerules rules not being editable in menu

* Updated `validate`'s javadoc

(cherry picked from commit a44e16a)
modmuss50 pushed a commit that referenced this pull request Nov 2, 2023
* Fix double gamerules rules not being editable in menu

* Updated `validate`'s javadoc

(cherry picked from commit a44e16a)
(cherry picked from commit ae9f657)
modmuss50 pushed a commit that referenced this pull request Nov 2, 2023
* Fix double gamerules rules not being editable in menu

* Updated `validate`'s javadoc

(cherry picked from commit a44e16a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merge me please Pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants