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

Option to disable automatic addition of environment annotations #1087

Open
MattiDragon opened this issue Apr 8, 2024 · 1 comment
Open
Milestone

Comments

@MattiDragon
Copy link

Loom currently adds @Environment(EnvType.CLIENT) to all client only minecraft classes with no way to disable. This isn't great as the annotations come from fabric loader, which isn't required for loom to work. The primary case where loom is used without loader is in multiloader setups, where loom is used for managing minecraft in the common subproject. Adding these annotations without loader on classpath results in ugly errors in IDEs and log spam from APs unable to resolve the annotations in the form of warning: unknown enum constant EnvType.CLIENT.

An option to disable environment annotations (or possibly to swap the out for a custom class) would improve the experiance when using loom for multiloader projects.

@modmuss50
Copy link
Member

This can likely be best fixed by allowing the jars to be split with splitMinecraftJar() without the adding the client only annotations. Care needs to be taken to ensure that the jar will get a diffrent name when this option is enabled. The API would be something like:

loom {
  splitMinecraftJar() {
     enableEnvAnnotations = false
   }
}

@modmuss50 modmuss50 added this to the 1.7 milestone Apr 8, 2024
@modmuss50 modmuss50 modified the milestones: 1.7, 1.8 Jun 14, 2024
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

No branches or pull requests

2 participants