Moved to maven

This commit is contained in:
stijnb1234 2020-11-16 18:52:42 +01:00
parent 833b55d6ca
commit 78c68f4f32
32 changed files with 382 additions and 2739 deletions

View file

@ -0,0 +1,5 @@
package me.mctp.api;
public enum AudioType {
MUSIC, SFX, RADIO
}

View file

@ -0,0 +1,5 @@
package me.mctp.api;
public enum HueType {
LEFT, MID, RIGHT, ALL
}

View 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);
}
}