juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
296 stars 50 forks source link

Dependency files size #103

Closed DxsSucuk closed 3 days ago

DxsSucuk commented 1 year ago

Is there a way to reduce the overall dependency size? For example no longer used dependencies or code that uses for example a single line of code from an dependency and nothing else?

I am asking for this since the dependency file is 4MB in size for bukkit (unsure about the rest). And this keeps people from directly uploading to SpigotMC for example, since their limit is about 5MB.

Could this be looked into?

portlek commented 1 year ago

I've reduced the size from 3mb~ to 110kb~. I've removed packetevents, because i'm already using protocollib. removed gson, because paper already has. removed kyori dependencies except the event one. and paperclip because i'm already using paper and 1.18.2+ no need to a library that the only thing it does is that checking versions and is paper or not. these are for my personal usages so i've just configured the gradle for my own purposes, you can also do that if you're using certain version of minecraft etc. but i'm not sure how much this can be applied to the project.

DxsSucuk commented 1 year ago

The Issue is I have a plugin that is made for every version after 1.8 so I would need the support, but the plugin also forces users to use ProtocolLib so yeah would love to remove packetevents is yours a fork of NPC-Lib? If so can you share the repository?

portlek commented 1 year ago

you can check it out here i've updated the gradle file structure a bit. you need to implement api, common and bukkit at the same time. bukkit does not come with all the dependencies like api and common. clone the repository and run ./gradlew publishToMavenLocal that's it. i've configured the repository for my own purposes so, if it does not work on your projects, i cannot do anything about it.

derklaro commented 3 days ago

There are no longer any dependencies shaded starting with beta8 which gives you full control which dependencies are included into the final jar.