Added support for vanilla mythic mob factions.

This commit is contained in:
Ethan 2020-09-09 15:12:50 -04:00
parent 36725a9cb4
commit 47907ab249

View File

@ -5,6 +5,7 @@ import io.lumine.xikage.mythicmobs.mobs.MythicMob;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.comp.mythicmobs.stat.FactionDamage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@ -22,9 +23,10 @@ public class MythicMobsLoader {
private Collection<String> getFactions(){
Collection<String> allFactions = new LinkedList<>();
for (MythicMob mob : MythicMobs.inst().getMobManager().getMobTypes()) {
if (mob.getFaction() != null) {
if (!allFactions.contains(mob.getFaction()))
Collection<MythicMob> mobs = new ArrayList<>(MythicMobs.inst().getMobManager().getVanillaTypes());
mobs.addAll(MythicMobs.inst().getMobManager().getMobTypes());
for (MythicMob mob : mobs) {
if (mob.getFaction() != null && !allFactions.contains(mob.getFaction())) {
allFactions.add(mob.getFaction());
}
}