Closed SamB440 closed 9 months ago
You may download and cache the required deps at runtime if needed.
You may download and cache the required deps at runtime if needed.
I am not aware of any solutions to do that though. You'd need it both on Spigot and Velocity and all the way back to 1.8.
Download the dependency jar with any http client you prefer to a cache dir and then use java.net.URLClassLoader to load it in so that you don't have to shadow it in your project. You may also read the config first to determine if the jar should be loaded. A lot of plugins (even bengeecord itself) do this trick so you might be able to find some examples.
Edit: example
Download the dependency jar with any http client you prefer to a cache dir and then use java.net.URLClassLoader to load it in so that you don't have to shadow it in your project. You may also read the config first to determine if the jar should be loaded. A lot of plugins (even bengeecord itself) do this trick so you might be able to find some examples.
Edit: example
Thanks, using a combination of LuckPerm's URLClassLoaderAccess (which that link uses) and this which I found: https://github.com/Vankka/DependencyDownload, since I wanted hash validation too, it works now.
Tested on 1.20.2 paper server without proxy and 1.20.2 paper server behind proxy. Don't care enough to test other versions, this should be fine to merge now.
Summary of changes:
try-to-stop-fake-accept-hacks
is enabled and forcepack reload
is used.prevent-damage
will now work with non-entity sources.Not in this PR, but for 1.3.0:
server.properties
is now checked to ensure there is not a resource pack present.global packs are not working anymore on velocity with this pull request
Try the new commit, also send the output of debug mode next time
Now it's working again, but when I switch downstream server the pack is always sent again, even though i am in 1.20.4
It seems velocity has not implemented getAppliedResourcePacks
. I am going to have to track this myself...
Please try the latest commit
Yeah thanks, now everything works as intended
but now there is a error when joining with 1.20.1 and the pack is not applied too
Should be fixed now.
AAAAAAAAAAAAAAAAAA.
Velocity hasn't implemented removeResourcePack(s) either!
I can't use packetevents on velocity either because it has issues with NBT data when switching worlds.
We have to wait for Velocity to update...
Alright, I've decided to implement it via reflection since the RemoveResourcePack packet class exists on velocity, the method just hasn't implemented it.
Everything should be good now.
yeah now everything works
This adds the ability to self-host the resource pack via a local web server and also adds support for 1.20.3. It also fixes various bugs.
One problem is the jar size is now massive because of the webserver, I don't know how to fix that.