mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Catch exceptions during hook initialization
This commit is contained in:
3 files changed
+21
-3
No files matched your search
@@ -189,7 +189,13 @@ public class SpongeHuskHomes implements HuskHomes, SpongeTask.Supplier, SpongeSa
|
||||
this.registerHooks();
|
||||
|
||||
if (hooks.size() > 0) {
|
||||
hooks.forEach(Hook::initialize);
|
||||
hooks.forEach(hook -> {
|
||||
try {
|
||||
hook.initialize();
|
||||
} catch (Throwable e) {
|
||||
log(Level.WARNING, "Failed to initialize " + hook.getName() + " hook", e);
|
||||
}
|
||||
});
|
||||
log(Level.INFO, "Registered " + hooks.size() + " mod hooks: " + hooks.stream()
|
||||
.map(Hook::getName)
|
||||
.collect(Collectors.joining(", ")));
|
||||
|
||||
Reference in new issue
Block a user