Skip to content

Better way to get classes from Heroes #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
osipxd opened this issue Feb 15, 2021 · 0 comments
Closed

Better way to get classes from Heroes #14

osipxd opened this issue Feb 15, 2021 · 0 comments

Comments

@osipxd
Copy link
Member

osipxd commented Feb 15, 2021

There's a better way to get all classes of the player if you want more than their current ones (primary, secondary and race) as well as mastered.

Set<HeroClass> loadedClasses = this.plugin.getClassManager().getClasses();
if (loadedClasses != null) {
    //Get classes the hero has been and leveled
    ArrayList<String> leveledClasses = new ArrayList<>();
    for (HeroClass heroClass : loadedClasses) {
        if (hero.getExperience(heroClass) > 0) {
            leveledClasses.add(heroClass.getName());
        }
    }
}

Message in Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant