From c0570371543ad9e8041da02eb0da9eeda196163d Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 16 Apr 2023 11:05:37 +0700 Subject: [PATCH] fix music list it took me ages to figure this out that i need to just CLONE THE LIST --- .../chipmunk/chayapak/chomens_bot/commands/MusicCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java index b33c236..bbeac63 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java @@ -255,8 +255,9 @@ public class MusicCommand implements Command { int index = 0; - while (index < fullList.size()) { - List list = fullList.subList(index, Math.min(index + eachSize, fullList.size())); + while (index <= fullList.size()) { + // we MUST make a new copy of the list else everything will fard..,. + List list = new ArrayList<>(fullList).subList(index, Math.min(index + eachSize, fullList.size())); final Component component = Component.join(JoinConfiguration.separator(Component.space()), list); context.sendOutput(component);