Fixed indexoutofbounds for playlist, by making it thread-safe
This commit is contained in:
parent
75aa099aef
commit
2deaf5dad7
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue