Skip to content

Commit

Permalink
Do not swallow errors on Spigot
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Jun 13, 2024
1 parent c4a4487 commit e1bae57
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions spigot/src/main/java/org/geysermc/floodgate/SpigotPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@ public void onEnable() {
boolean usePaperListener = ReflectionUtils.getClassSilently(
"com.destroystokyo.paper.event.profile.PreFillProfileEvent") != null;

try {
platform.enable(
new SpigotCommandModule(this),
new SpigotAddonModule(),
new PluginMessageModule(),
(usePaperListener ? new PaperListenerModule() : new SpigotListenerModule())
);
} catch (Exception exception) {
Bukkit.getPluginManager().disablePlugin(this);
throw exception;
}
platform.enable(
new SpigotCommandModule(this),
new SpigotAddonModule(),
new PluginMessageModule(),
(usePaperListener ? new PaperListenerModule() : new SpigotListenerModule())
);

injector.getInstance(HandshakeHandlers.class)
.addHandshakeHandler(injector.getInstance(SpigotHandshakeHandler.class));
Expand Down

0 comments on commit e1bae57

Please # to comment.