All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.magemonkey.fabled.hook.mimic.FabledClassSystem Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.0.0-R1
Show newest version
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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy