Skip to content

Commit

Permalink
check if event is active in rank listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaktushose committed Aug 31, 2024
1 parent ba3c6f3 commit 71ac119
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
onXpLootDrop(event);
onCheckForLootbox(event);
onAddRegularXp(event);

if (!eventService.isCollectEventActive()) {
return;
}
onAddRegularCollectPoints(event);
onCollectLootDrop(event);
}
Expand Down Expand Up @@ -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) {
Expand All @@ -233,6 +233,9 @@ private void onCollectLootDrop(MessageReceivedEvent event) {


private void onCollectEventDropReactionAdd(MessageReactionAddEvent event) {
if (!eventService.isCollectEventActive()) {
return;
}
if (event.getUser().isBot()) {
return;
}
Expand Down

0 comments on commit 71ac119

Please sign in to comment.