From 67b242440b79352602c8328158effcd5a4c1fda9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 2 Jul 2016 14:01:31 +1000 Subject: [PATCH] SPIGOT-1515: Use CUSTOM reason for GENERIC damage --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index eac41e0e66..5c9ea4dec0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -551,7 +551,7 @@ public class CraftEventFactory { } else if (source == DamageSource.FLY_INTO_WALL) { cause = DamageCause.FLY_INTO_WALL; } else if (source == DamageSource.GENERIC) { - return new EntityDamageEvent(entity.getBukkitEntity(), null, modifiers, modifierFunctions); + cause = DamageCause.CUSTOM; } if (cause != null) { @@ -581,7 +581,7 @@ public class CraftEventFactory { private static final Function ZERO = Functions.constant(-0.0); public static EntityDamageEvent handleLivingEntityDamageEvent(Entity damagee, DamageSource source, double rawDamage, double hardHatModifier, double blockingModifier, double armorModifier, double resistanceModifier, double magicModifier, double absorptionModifier, Function hardHat, Function blocking, Function armor, Function resistance, Function magic, Function absorption) { - Map modifiers = new EnumMap(DamageModifier.class); + Map modifiers = new EnumMap(DamageModifier.class); Map> modifierFunctions = new EnumMap>(DamageModifier.class); modifiers.put(DamageModifier.BASE, rawDamage); modifierFunctions.put(DamageModifier.BASE, ZERO);