Search in sources :

Example 1 with Requirement

use of de.Keyle.MyPet.api.skill.skilltree.requirements.Requirement in project MyPet by xXKeyleXx.

the class Skilltree method checkRequirements.

public boolean checkRequirements(MyPet pet) {
    boolean usable = true;
    for (Settings flagSettings : requirementSettings) {
        String reqName = flagSettings.getName();
        Requirement requirement = MyPetApi.getSkilltreeManager().getRequirement(reqName);
        if (requirement == null) {
            MyPetApi.getLogger().warning("\"" + reqName + "\" is not a valid skilltree requirement!");
            continue;
        }
        if (!requirement.check(this, pet, flagSettings)) {
            usable = false;
        }
        if (!usable) {
            break;
        }
    }
    return usable;
}
Also used : Requirement(de.Keyle.MyPet.api.skill.skilltree.requirements.Requirement) Settings(de.Keyle.MyPet.api.util.configuration.settings.Settings)

Aggregations

Requirement (de.Keyle.MyPet.api.skill.skilltree.requirements.Requirement)1 Settings (de.Keyle.MyPet.api.util.configuration.settings.Settings)1