Initial commit: LoParkour v1.1.0
This commit is contained in:
commit
aecb03ccf8
120 changed files with 9668 additions and 0 deletions
28
src/main/java/dev/loki/loparkour/style/RandomStyle.java
Normal file
28
src/main/java/dev/loki/loparkour/style/RandomStyle.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package dev.loki.loparkour.style;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public final class RandomStyle implements Style {
|
||||
|
||||
private final String name;
|
||||
private final List<Material> materials;
|
||||
|
||||
public RandomStyle(String name, List<Material> materials) {
|
||||
this.name = name;
|
||||
this.materials = materials;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getNext() {
|
||||
return materials.get(ThreadLocalRandom.current().nextInt(materials.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
22
src/main/java/dev/loki/loparkour/style/Style.java
Normal file
22
src/main/java/dev/loki/loparkour/style/Style.java
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package dev.loki.loparkour.style;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Represents a parkour style.
|
||||
*/
|
||||
public interface Style {
|
||||
|
||||
/**
|
||||
* The material to be used for the next block.
|
||||
* @return A material.
|
||||
*/
|
||||
Material getNext();
|
||||
|
||||
/**
|
||||
* The name of the style.
|
||||
* @return A name.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue