Closed jhead closed 7 years ago
This issue appears to only occur as of 1.12.2.
On the latest 1.12.1 build 1204
and earlier, this worked as expected, launching out of the cache
folder even when that is not ./cache
relative to the PaperClip JAR.
I believe I found the cause of this issue.
The old version read the path of the patched JAR to a URL, then added that to the ClassLoader before invoking the main class: https://github.com/PaperMC/Paperclip/blob/6dcb3241ca8e69fb8209e54fea507425c508915e/src/main/java/com/destroystokyo/paperclip/Paperclip.java#L265
The current build instead moves that to a separate class, and in the process, adding to the ClassLoader was dropped: https://github.com/PaperMC/Paperclip/blob/c56226165db05fbd50f4951bda32452330f160e2/java8/src/main/java/com/destroystokyo/paperclip/Utils.java#L55
Problem
When launching Paperclip from the server directory while the Paperclip jar is stored in a subdirectory, downloads succeed but it then fails to find the
cache
folder.Logs
Directory listing after launch
Steps to reproduce
cd
to parent directoryjava -jar subdir/paperclip.jar
Workaround
Moving the
cache
dir into the subdir causes Paperclip to re-download the files, but then launches properly. Creating a symlink works as well.Proposed Solution
Ideally, Paperclip would look for the
cache
dir in the same place that it downloaded it, not in relation to the Paperclip jar itself.