From 71ac11921f38c7cf79571bccf99033c5144f5251 Mon Sep 17 00:00:00 2001 From: Kaktushose Date: Sat, 31 Aug 2024 19:42:24 +0200 Subject: [PATCH] check if event is active in rank listener --- .../github/kaktushose/nplaybot/rank/RankListener.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/kaktushose/nplaybot/rank/RankListener.java b/src/main/java/com/github/kaktushose/nplaybot/rank/RankListener.java index 7c6590d..73e0f86 100644 --- a/src/main/java/com/github/kaktushose/nplaybot/rank/RankListener.java +++ b/src/main/java/com/github/kaktushose/nplaybot/rank/RankListener.java @@ -87,6 +87,10 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) { onXpLootDrop(event); onCheckForLootbox(event); onAddRegularXp(event); + + if (!eventService.isCollectEventActive()) { + return; + } onAddRegularCollectPoints(event); onCollectLootDrop(event); } @@ -216,10 +220,6 @@ private void onCollectPointChange(int oldPoints, int newPoints, Member member, G } private void onCollectLootDrop(MessageReceivedEvent event) { - if (!eventService.isCollectEventActive()) { - return; - } - var points = eventService.getCollectLootDrop(event.getMessage()); if (points < 1) { @@ -233,6 +233,9 @@ private void onCollectLootDrop(MessageReceivedEvent event) { private void onCollectEventDropReactionAdd(MessageReactionAddEvent event) { + if (!eventService.isCollectEventActive()) { + return; + } if (event.getUser().isBot()) { return; }