Skip to content

Make ISBRH render ID static final and make registration explicit #4745

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

Merged
merged 1 commit into from
Aug 16, 2025

Conversation

Alexdoru
Copy link
Member

@Alexdoru Alexdoru commented Aug 16, 2025

Object constructors should be only setting up fields.
They should not be assigning static fields.
They should not be registering this to something.
new Objects shouldn't be dangling in the code without anything using them because it turns out the constructor is actually running code that is doing doing somthing other than just constructing the object.

This PR removes the above and replaces it with explicit registration in the form Something.register(new SomeISBRH() for ISimpleBlockRenderingHandler.
It also makes the render static final to clearly indicate that it should never change.

@Alexdoru Alexdoru added the Refactor For PRs rewriting a part of the code to have a nicer code overall. label Aug 16, 2025
@Dream-Master Dream-Master requested a review from a team August 16, 2025 10:27
Copy link
Contributor

@leagris leagris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks way better and seeing nothing wrong in it.

@Dream-Master Dream-Master merged commit 648faaa into master Aug 16, 2025
6 of 7 checks passed
@Dream-Master Dream-Master deleted the del-registers-in-constructors branch August 16, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor For PRs rewriting a part of the code to have a nicer code overall.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants