Using the bukkit API, is it possible to make a call that would do something like the following pseudocode:
Bukkit.getPluginManager().getPlugin("PluginName").getJarFile();
Where for a plugin like MobBountyReloaded, it would return plugins/MobBountyReloaded_v235.jar
.
I tried just looking for files using well-known naming-schemes like just appending .jar
or <version>.jar
to the name of the plugin, but that doesn't always yield correct results. The above example fails because the version number in the plugin.yml
file is just 235
and not _v235
, and some plugins use schemes like <PluginName>-<Version>-<buildnumber>.jar
.
Is there a simple way to accomplish this? The File information for every loaded plugin must be somewhere in memory, no?