Fixed issue
This commit is contained in:
parent
0bbb436992
commit
bb416ee075
1 changed files with 4 additions and 4 deletions
|
@ -23,13 +23,13 @@ public class CommandListener {
|
||||||
private static final ArrayList<Short> usableServerReadyStrings = new ArrayList<Short>(serverReadyStrings.length) {
|
private static final ArrayList<Short> usableServerReadyStrings = new ArrayList<Short>(serverReadyStrings.length) {
|
||||||
private static final long serialVersionUID = 2213771460909848770L;
|
private static final long serialVersionUID = 2213771460909848770L;
|
||||||
{
|
{
|
||||||
createUsableServerReadyStrings();
|
createUsableServerReadyStrings(this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static void createUsableServerReadyStrings() {
|
private static void createUsableServerReadyStrings(ArrayList<Short> list) {
|
||||||
for (short i = 0; i < serverReadyStrings.length; i++)
|
for (short i = 0; i < serverReadyStrings.length; i++)
|
||||||
usableServerReadyStrings.add(i);
|
list.add(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IListener<?>[] getListeners() {
|
public static IListener<?>[] getListeners() {
|
||||||
|
@ -60,7 +60,7 @@ public class CommandListener {
|
||||||
* (next == j) next++; if (next >= serverReadyStrings.length) next = 0; } lastServerReadyStrings.add(next); }
|
* (next == j) next++; if (next >= serverReadyStrings.length) next = 0; } lastServerReadyStrings.add(next); }
|
||||||
*/
|
*/
|
||||||
if (usableServerReadyStrings.size() == 0)
|
if (usableServerReadyStrings.size() == 0)
|
||||||
createUsableServerReadyStrings();
|
createUsableServerReadyStrings(usableServerReadyStrings);
|
||||||
next = usableServerReadyStrings.remove(serverReadyRandom.nextInt(usableServerReadyStrings.size()));
|
next = usableServerReadyStrings.remove(serverReadyRandom.nextInt(usableServerReadyStrings.size()));
|
||||||
DiscordPlugin.sendMessageToChannel(event.getMessage().getChannel(), serverReadyStrings[next]);
|
DiscordPlugin.sendMessageToChannel(event.getMessage().getChannel(), serverReadyStrings[next]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue