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

Split source sets #117

Open
Technici4n opened this issue Feb 11, 2024 · 1 comment
Open

Split source sets #117

Technici4n opened this issue Feb 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Technici4n
Copy link
Member

Technici4n commented Feb 11, 2024

Feature request: Introduce split source sets, a feature that mods can opt into to have client and common code in separate source sets. This provides a compile-time guarantee that client code will never be called from common code (which also needs to run on dedicated servers). It has been confirmed that Minecraft is developed with a similar setup.

Potential problems:

  • The common source set should not be allowed to call client-only code from other mods. One solution is to auto-split mod dependencies based on the @OnlyIn annotation (requires mod dependency scanning :/). Another solution is to allow mods to publish separate artifacts for their client-only and common code.
  • Split source sets need to be used in NeoForge before they are usable in userdev.
  • (To be confirmed) Eclipse support for source sets is quite bad, and might not support this.
@Technici4n Technici4n added the enhancement New feature or request label Feb 11, 2024
@lukebemish
Copy link
Contributor

Allowing mods to publish separate client/shared artifacts should not be particularly difficult, all things considered; it's not hard to solve at all with the variant selection tools that gradle gives you.

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

No branches or pull requests

2 participants