Fixed indexoutofbounds for playlist, by making it thread-safe

This commit is contained in:
Stijn Bannink 2022-05-04 17:07:16 +00:00
parent 75aa099aef
commit 2deaf5dad7

View file

@ -12,6 +12,7 @@ import org.bukkit.scheduler.BukkitTask;
import org.json.simple.JSONObject;
import java.io.IOException;
import java.util.Collections;
/* Copyright (C) McThemeParks - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
@ -20,7 +21,7 @@ import java.io.IOException;
*/
public class Playlist {
private final SongList<String> playList = new SongList<>();
private final SongList<String> playList = Collections.synchronizedList(new SongList<>());
private final SongList<String> playedList = new SongList<>();
private boolean running = false;