Update PluginUtils.java

This commit is contained in:
allenlol 2018-10-02 17:48:58 -07:00 committed by GitHub
parent ccc1d69707
commit eaf9bac6ec

View File

@ -31,9 +31,9 @@ public class PluginUtils {
PluginUtils() { PluginUtils() {
} }
private File getPluginFile(JavaPlugin plugin) { private File getPluginFile(Plugin plugin) {
try { try {
Method method = JavaPlugin.class.getDeclaredMethod("getFile"); Method method = plugin.getClass().getDeclaredMethod("getFile");
method.setAccessible(true); method.setAccessible(true);
return (File) method.invoke(plugin); return (File) method.invoke(plugin);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {