From f5acc00f8a5450fc00138bf8ac7744ca480a9462 Mon Sep 17 00:00:00 2001 From: Vankka Date: Thu, 20 Jan 2022 20:19:51 +0200 Subject: [PATCH] Make Module#enable call Module#reload by default --- .../com/discordsrv/common/channel/ChannelUpdaterModule.java | 5 ----- .../main/java/com/discordsrv/common/module/type/Module.java | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/discordsrv/common/channel/ChannelUpdaterModule.java b/common/src/main/java/com/discordsrv/common/channel/ChannelUpdaterModule.java index 94636c51..2a86541e 100644 --- a/common/src/main/java/com/discordsrv/common/channel/ChannelUpdaterModule.java +++ b/common/src/main/java/com/discordsrv/common/channel/ChannelUpdaterModule.java @@ -42,11 +42,6 @@ public class ChannelUpdaterModule extends AbstractModule { super(discordSRV); } - @Override - public void enable() { - reload(); - } - @Override public void reload() { futures.forEach(future -> future.cancel(false)); diff --git a/common/src/main/java/com/discordsrv/common/module/type/Module.java b/common/src/main/java/com/discordsrv/common/module/type/Module.java index 384fb6bc..702f48a6 100644 --- a/common/src/main/java/com/discordsrv/common/module/type/Module.java +++ b/common/src/main/java/com/discordsrv/common/module/type/Module.java @@ -34,7 +34,10 @@ public interface Module { return 0; } - default void enable() {} + default void enable() { + reload(); + } + default void disable() {} default void reload() {} }