From 52f38c04ffd05941d6f7a22d34613186216a1762 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 2 Jul 2016 14:01:31 +1000 Subject: [PATCH] SPIGOT-1515: Use CUSTOM reason for GENERIC damage By: md_5 --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index eac41e0e66..5c9ea4dec0 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/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);