fix music list

it took me ages to figure this out that i need to just
CLONE THE LIST
This commit is contained in:
Chayapak 2023-04-16 11:05:37 +07:00
parent f1492a7a1b
commit c057037154

View file

@ -255,8 +255,9 @@ public class MusicCommand implements Command {
int index = 0;
while (index < fullList.size()) {
List<Component> 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<Component> 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);