studio.magemonkey.fabled.hook.mimic.FabledClassSystem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabled Show documentation
Show all versions of fabled Show documentation
A Minecraft Bukkit plugin aiming to provide an easy code API and skill editor for all server owners to
create unique and fully custom classes and skills.
package studio.magemonkey.fabled.hook.mimic;
import studio.magemonkey.fabled.Fabled;
import studio.magemonkey.fabled.api.player.PlayerClass;
import studio.magemonkey.fabled.api.player.PlayerData;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import ru.endlesscode.mimic.classes.BukkitClassSystem;
import java.util.List;
import java.util.stream.Collectors;
public class FabledClassSystem extends BukkitClassSystem {
public FabledClassSystem(@NotNull Player player) {
super(player);
}
@NotNull
@Override
public List getClasses() {
return getPlayerData().getClasses()
.stream()
.map(playerClass -> playerClass.getData().getName())
.collect(Collectors.toList());
}
@Nullable
@Override
public String getPrimaryClass() {
PlayerClass mainClass = getPlayerData().getMainClass();
return mainClass != null ? mainClass.getData().getName() : null;
}
private PlayerData getPlayerData() {
return Fabled.getData(getPlayer());
}
}