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

KubeJS builder refactor #2574

Merged
merged 8 commits into from
Dec 19, 2024
Merged

KubeJS builder refactor #2574

merged 8 commits into from
Dec 19, 2024

Conversation

screret
Copy link
Member

@screret screret commented Dec 17, 2024

What

removes the varargs objects for machine tiers and elements, and cleans up the whole thing.
machines now pass the tiers in a method and the modification to specific builders is applied via a lambda in definition((tier, builder) => ...)
multiblocks with a single tier will stay the same. ones with multiple tiers will use the same paradigm as singleblocks, but with a different type.

elements, which also used this system, will now just set all the parameters via a builder pattern.

Implementation Details

  • removed varargs object[] methods from GTRegistryEventJS
  • completely replaced how tiered machines are registered
  • fixed a bug where the game wouldn't launch if curios wasn't installed
  • removed the RendererBlockItem class as we didn't use it anywhere except erroneously in the coil block builder.

Outcome

better machine registration on the java side, much cleaner code

Additional Information

example.zip

@screret screret added the type: refactor Suggestion to refactor a section of code label Dec 17, 2024
@screret screret requested a review from a team as a code owner December 17, 2024 12:29
@screret screret merged commit 32e24ec into 1.20.1 Dec 19, 2024
3 checks passed
@screret screret deleted the sc/kjs-builder-refactor branch December 19, 2024 06:54
screret added a commit that referenced this pull request Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor Suggestion to refactor a section of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants