#1362: Include Creeper igniter in causing entity for damage events
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -940,7 +940,7 @@ public class CraftEventFactory {
|
||||
|
||||
private static EntityDamageEvent handleEntityDamageEvent(Entity entity, DamageSource source, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) {
|
||||
CraftDamageSource bukkitDamageSource = new CraftDamageSource(source);
|
||||
Entity damager = source.getCausingEntity();
|
||||
Entity damager = (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) ? source.getDirectEntity() : source.getCausingEntity();
|
||||
if (source.is(DamageTypeTags.IS_EXPLOSION)) {
|
||||
if (damager == null) {
|
||||
return callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
||||
@@ -950,10 +950,6 @@ public class CraftEventFactory {
|
||||
} else if (damager != null || source.getDirectEntity() != null) {
|
||||
DamageCause cause = (source.isSweep()) ? DamageCause.ENTITY_SWEEP_ATTACK : DamageCause.ENTITY_ATTACK;
|
||||
|
||||
if (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) {
|
||||
damager = source.getDirectEntity();
|
||||
}
|
||||
|
||||
if (damager instanceof IProjectile) {
|
||||
if (damager.getBukkitEntity() instanceof ThrownPotion) {
|
||||
cause = DamageCause.MAGIC;
|
||||
|
||||
Reference in New Issue
Block a user