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

dev.aurelium.auraskills.api.event.skill.SkillsLoadEvent Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
package dev.aurelium.auraskills.api.event.skill;

import dev.aurelium.auraskills.api.skill.Skill;
import dev.aurelium.auraskills.api.skill.Skills;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

import java.util.Set;

/**
 * Calls when skills have finished loading from configuration files, which is usually
 * on the first tick of the server. Most methods on {@link Skill} will not work until
 * this event calls. Listen to this event if accessing methods on default {@link Skills}
 * during plugin startup instead of in onEnable.
 */
public class SkillsLoadEvent extends Event {

    private static final HandlerList handlers = new HandlerList();

    private final Set skills;

    public SkillsLoadEvent(Set skills) {
        this.skills = skills;
    }

    /**
     * Gets all the skills that the plugin has loaded. Some skills may be disabled by users
     * through the config so use {@link Skill#isEnabled()} to check whether a skill is enabled.
     *
     * @return the loaded skills
     */
    public Set getSkills() {
        return skills;
    }

    @NotNull
    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy