Add damage modifier API in EntityDamageEvent. Adds BUKKIT-347, BUKKIT-4104
This commit adds API for the enchantment, armor, potion and other modifications to damage done to an entity. These damage modifiers are each editable editable via a getter and a setter. This addition allows for more accurate modification and monitoring of damage done to/by an entity, as it displays the final damage done as well.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
/**
|
||||
@@ -13,11 +15,17 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent {
|
||||
this(damager, damagee, cause, (double) damage);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final double damage) {
|
||||
super(damagee, cause, damage);
|
||||
this.damager = damager;
|
||||
}
|
||||
|
||||
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final Map<DamageModifier, Double> modifiers) {
|
||||
super(damagee, cause, modifiers);
|
||||
this.damager = damager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entity that damaged the defender.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user