mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-08 07:27:39 +01:00
!Attack results now work with sets
This commit is contained in:
parent
77edbaf992
commit
5bdfcf299a
@ -1,7 +1,6 @@
|
||||
package net.Indyuce.mmoitems.api;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
@ -14,18 +13,18 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class ItemAttackResult extends AttackResult {
|
||||
public ItemAttackResult(boolean successful, DamageType... types) {
|
||||
this(successful, 0, types);
|
||||
super(successful, 0, types);
|
||||
}
|
||||
|
||||
public ItemAttackResult(double damage, DamageType... types) {
|
||||
this(true, damage, types);
|
||||
super(true, damage, types);
|
||||
}
|
||||
|
||||
public ItemAttackResult(boolean successful, double damage, DamageType... types) {
|
||||
this(successful, damage, Arrays.asList(types));
|
||||
super(successful, damage, types);
|
||||
}
|
||||
|
||||
public ItemAttackResult(boolean successful, double damage, List<DamageType> types) {
|
||||
public ItemAttackResult(boolean successful, double damage, Set<DamageType> types) {
|
||||
super(successful, damage, types);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class HeroesHook implements RPGHandler, Listener, DamageHandler {
|
||||
@Override
|
||||
public AttackResult getDamage(Entity entity) {
|
||||
SkillUseInfo info = Heroes.getInstance().getDamageManager().getSpellTargetInfo(entity);
|
||||
return new AttackResult(true, 0, info.getSkill().getTypes().stream().filter(type -> damages.containsKey(type)).map(type -> damages.get(type)).collect(Collectors.toList()));
|
||||
return new AttackResult(true, 0, info.getSkill().getTypes().stream().filter(type -> damages.containsKey(type)).map(type -> damages.get(type)).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user