Skip to content

Commit

Permalink
Reverted 8ffc1dc
Browse files Browse the repository at this point in the history
  • Loading branch information
drdanick committed Aug 7, 2012
1 parent acde4eb commit 9f93123
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/me/neatmonster/spacebukkit/plugins/PluginsManager.java
Expand Up @@ -43,11 +43,11 @@ public class PluginsManager {
* @return Jar File the plugin's code is contained in
*/
public static File getJAR(final Plugin plugin) {
Class<?> currentClass = plugin.getClass();
while (!(currentClass.equals(JavaPlugin.class))) {
currentClass = currentClass.getSuperclass();
}
try {
Class<?> currentClass = plugin.getClass();
while (!(currentClass.equals(JavaPlugin.class))) {
currentClass = currentClass.getSuperclass();
}
final Class<?>[] methodArgs = {};
final Method method = currentClass.getDeclaredMethod("getFile", methodArgs);
method.setAccessible(true);
Expand All @@ -63,8 +63,6 @@ public static File getJAR(final Plugin plugin) {
e.printStackTrace();
} catch (final InvocationTargetException e) {
e.printStackTrace();
} catch (final NullPointerException e) {
// Ignore
}
return null;
}
Expand All @@ -76,6 +74,9 @@ public PluginsManager() {
new Thread(new PluginsRequester()).start();
final YamlConfiguration configuration = YamlConfiguration.loadConfiguration(JARS_FILE);
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
if (plugin == null) {
continue;
}
final File jar = getJAR(plugin);
if (jar != null)
configuration.set(plugin.getDescription().getName().toLowerCase().replace(" ", ""),
Expand Down

1 comment on commit 9f93123

@tips48
Copy link
Contributor

@tips48 tips48 commented on 9f93123 Aug 10, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a fix made after this?

Please sign in to comment.