Skip to content

Conversation

@jurrejelle
Copy link
Contributor

What

Add second generic to MachineBuilder and reduce code duplication

Implementation Details

go from MachineBuilder<DEFINITION extends MachineDefinition> extends BuilderBase<DEFINITION> to MachineBuilder<DEFINITION extends MachineDefinition, TYPE extends MachineBuilder<DEFINITION, TYPE>> extends BuilderBase<DEFINITION>

Outcome

No longer need to add a public MultiblockMachineBuilder foo(Bar bar){ (MultiblockMachineBuilder) super.foo(bar) }; for every. single. MachineBuilder. method.

Additional Information

Unfortunately Lombok doesn't support returning getThis() and TYPE, so I had to un-lombok both classes for setters.

Genericslop.

Potential Compatibility Issues

People who store partially finished builders need to move from MachineBuilder to MachineBuilder

@jurrejelle jurrejelle requested a review from a team as a code owner January 5, 2026 15:40
@jurrejelle jurrejelle added type: refactor Suggestion to refactor a section of code 1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. labels Jan 5, 2026
@github-actions github-actions bot added the Tests: Passed Game Tests have passed on this PR label Jan 5, 2026
@jurrejelle jurrejelle force-pushed the jj/move-multiblock-builder-to-generic-system branch from 4d10523 to 11a51c5 Compare January 5, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants