use of net.poweredbyhate.wildtp.TeleportGoneWild.Trigger in project WildernessTp by AcmeProject.
the class WorldConfig method hurryPeter.
private HashMap<Trigger, PotionEffect[]> hurryPeter(ConfigurationSection v, ConfigurationSection d, int w) {
HashMap<Trigger, PotionEffect[]> map = new HashMap<Trigger, PotionEffect[]>();
for (Trigger when : Trigger.values()) {
HashSet<PotionEffect> effects = new HashSet<PotionEffect>();
String emmaString = "Effects." + when.toString();
List<String> emmaGivDis = (v != null && v.contains(emmaString)) ? v.getStringList(emmaString) : d.getStringList(emmaString);
emmaGivDis.forEach(patronus -> {
String[] spell = patronus.split(":");
PotionEffectType agrud = PotionEffectType.getByName(spell[0]);
if (agrud == null)
return;
int voldo = 0;
if (spell.length == 2)
try {
voldo = Integer.parseInt(spell[1]);
} catch (NumberFormatException e) {
}
effects.add(new PotionEffect(agrud, w + 1200, voldo, false, false, false));
});
map.put(when, (PotionEffect[]) effects.toArray(new PotionEffect[] {}));
}
return map;
}
Aggregations