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

Don't depend on the entire Fabric API all at once #9

Closed
LoganDark opened this issue Apr 5, 2022 · 7 comments
Closed

Don't depend on the entire Fabric API all at once #9

LoganDark opened this issue Apr 5, 2022 · 7 comments

Comments

@LoganDark
Copy link

LoganDark commented Apr 5, 2022

IceJar depends on a very minimal subset of Fabric API, so it's not fair to declare a dependency on the entire fabric mod. AFAIK these are all of the imports IceJar uses from Fabric API (found via GitHub search):

import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.player.AttackBlockCallback;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
import net.fabricmc.fabric.api.event.player.UseItemCallback;

so:

  • fabric-command-api-v1
  • fabric-entity-events-v1
  • fabric-lifecycle-events-v1
  • fabric-events-interaction-v0

Fabric API itself has like 40 other modules, so it would be nice not to force their inclusion.

This is likely something to be fixed on release rather than in development, but it's still worth tracking as an issue imho.

@samolego
Copy link
Owner

samolego commented Apr 5, 2022

That's totally doable, but I can't see how an end user would benefit from that :P.

I'll keep it in mind though. IRL stuff is getting in the way atm :P.

@LoganDark
Copy link
Author

I can't see how an end user would benefit from that :P

Server admins will - for example, I'd have no need, as a vanilla-like server, to sync registries with or announce custom networking packets to Fabric clients, if there are no mods installed that would utilize that functionality. It's more a peace of mind thing than an actual practical performance degradation, even with 40+ API modules.

@LoganDark
Copy link
Author

I've made a suggestion on the template repository that goes into more detail on this: FabricMC/fabric-example-mod#175

@samolego
Copy link
Owner

samolego commented May 1, 2022

I've tried getting this to work, but it crashes when starting to load server on modules that shouldn't even be loaded (e.g. registry-sync) 🤔

@samolego
Copy link
Owner

samolego commented May 2, 2022

It seems that it was due to config2brigadier lib; however, I'll wait to see how the mentioned issue plays out

@LoganDark
Copy link
Author

ah, another mod depending on the entirety of fabric would do it, yep. If you do this in all your mods then it might take a while to transition.

@LoganDark
Copy link
Author

Thanks!

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