Skip to content

Add reflection based init for Commands and Modules #5548

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Big-Iron-Cheems
Copy link
Collaborator

Type of change

  • Bug fix
  • New feature

Description

This implementation provides ways for addons to register their own packages, and add commands/modules conditionally.
Also removes deprecated and long unused List<Module> modules field.

Related issues

None.

How Has This Been Tested?

Tested in singleplayer world.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

This implementation provides ways for addons to register their own packages, and add commands/modules conditionally.
Only keeping the loaded count message as it is useful to ensure correct reflection loading.
@Big-Iron-Cheems
Copy link
Collaborator Author

Build died, perhaps a desync in my files, will checkout.

@MukjepScarlet
Copy link

This is not good because it uses reflection on the user start the client. It would be better to do this in compile-time like Lombok.

@Big-Iron-Cheems
Copy link
Collaborator Author

This PR is a very simplified implementation of this branch by @RacoonDog: https://github.com/RacoonDog/meteor-client/tree/module-initialization

The goal is to eventually support proper reflection based init in such a way that we can define flexible conditions and support add-ons as well.

What Lombok does is not enough for what we're aiming to do.

@MukjepScarlet
Copy link

Yes, If you wanna support external modules, reflection is needed. If only built-in ones, codegen at compile time will be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants