Hello Spigotters! I need a method to get the plugin jar File. Obviously following only works if the jar name is unattended, and can easily lead to errors if the user has renamed the file. Code (Text): new File("plugins/MyPlugin.jar") Is there any universal way to always point to the actual plugin jar? EDIT: Solved by @blablubbabc. Thanks kindly! (using JavaPlugin#getFile()) Thanks beforehand! Sincerely, kangarko
I'd just go about it by loading it's plugin.yml. If there's multiple with the same main, SHA-128/-256/-512
I am trying to get my plugin's file, but to be name-independand. I was using this so far: new File("plugins/MyPlugin.jar") but in public plugins, one can easily rename the jar (e.g. MyPlugin to MySuperPlugin) and then it would fail.
Yeah I am not fluent, sometimes it's hard to express myself in a way that most of you will understand, haha Sorry for that!