Skip to content

Commit

Permalink
Fixed HooksManager logging hook failures even if the target plugin is…
Browse files Browse the repository at this point in the history
… not available
  • Loading branch information
Poslovitch committed Jan 27, 2019
1 parent aea0573 commit 9afb5c6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ public void registerHook(Hook hook) {
plugin.log("Hooking with " + hook.getPluginName() + "...");
if (hook.hook()) {
hooks.add(hook);
return;
} else {
plugin.log("Could not hook with " + hook.getPluginName() + ((hook.getFailureCause() != null) ? " because: " + hook.getFailureCause() : "") + ". Skipping...");
}
}
plugin.log("Could not hook with " + hook.getPluginName() + ((hook.getFailureCause() != null) ? " because: " + hook.getFailureCause() : "") + ". Skipping...");
// Do not tell the user if we couldn't hook with a plugin which is not available.
// We may have in the near future almost ~25 hooks, which would basically spam the console and make users nervous.
}

public List<Hook> getHooks() {
Expand Down

0 comments on commit 9afb5c6

Please sign in to comment.