Moved to maven
This commit is contained in:
parent
833b55d6ca
commit
78c68f4f32
32 changed files with 382 additions and 2739 deletions
5
src/main/java/me/mctp/api/AudioType.java
Normal file
5
src/main/java/me/mctp/api/AudioType.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package me.mctp.api;
|
||||
|
||||
public enum AudioType {
|
||||
MUSIC, SFX, RADIO
|
||||
}
|
5
src/main/java/me/mctp/api/HueType.java
Normal file
5
src/main/java/me/mctp/api/HueType.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package me.mctp.api;
|
||||
|
||||
public enum HueType {
|
||||
LEFT, MID, RIGHT, ALL
|
||||
}
|
28
src/main/java/me/mctp/api/maps/Playlist.java
Normal file
28
src/main/java/me/mctp/api/maps/Playlist.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package me.mctp.api.maps;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Playlist<E> extends ArrayList<E> {
|
||||
public void shuffle() {
|
||||
Random random = new Random();
|
||||
|
||||
for (int index = 0; index < this.size(); index++) {
|
||||
int secondIndex = random.nextInt(this.size());
|
||||
swap(index, secondIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public E getRandom() {
|
||||
Random random = new Random();
|
||||
|
||||
return this.get(random.nextInt(this.size()));
|
||||
}
|
||||
|
||||
private void swap(int firstIndex, int secondIndex) {
|
||||
E first = this.get(firstIndex);
|
||||
E second = this.get(secondIndex);
|
||||
|
||||
this.set(secondIndex, first);
|
||||
this.set(firstIndex, second);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue