diff --git a/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java b/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java index 45af0a0bf..3907096c5 100644 --- a/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java +++ b/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageByEntityEvent.java @@ -13,10 +13,9 @@ import com.google.common.base.Functions; * Called when mcMMO applies damage from an entity due to special abilities. */ public class FakeEntityDamageByEntityEvent extends EntityDamageByEntityEvent { - private static final EnumMap> functionModifiers = getFunctionModifiers(); public FakeEntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, final Map modifiers) { - super(damager, damagee, cause, modifiers, functionModifiers); + super(damager, damagee, cause, modifiers, getFunctionModifiers(modifiers)); } @Deprecated @@ -24,11 +23,11 @@ public class FakeEntityDamageByEntityEvent extends EntityDamageByEntityEvent { super(damager, damagee, cause, damage); } - public static EnumMap> getFunctionModifiers() { + public static EnumMap> getFunctionModifiers(Map modifiers) { EnumMap> modifierFunctions = new EnumMap>(DamageModifier.class); Function ZERO = Functions.constant(-0.0); - for (DamageModifier modifier : DamageModifier.values()) { + for (DamageModifier modifier : modifiers.keySet()) { modifierFunctions.put(modifier, ZERO); } diff --git a/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java b/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java index c74afe443..16cb42a9c 100644 --- a/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java +++ b/src/main/java/com/gmail/nossr50/events/fake/FakeEntityDamageEvent.java @@ -13,10 +13,9 @@ import com.google.common.base.Functions; * Called when mcMMO applies damage due to special abilities. */ public class FakeEntityDamageEvent extends EntityDamageEvent { - private static final EnumMap> functionModifiers = getFunctionModifiers(); public FakeEntityDamageEvent(Entity damagee, DamageCause cause, final Map modifiers) { - super(damagee, cause, modifiers, functionModifiers); + super(damagee, cause, modifiers, getFunctionModifiers(modifiers)); } @Deprecated @@ -24,11 +23,11 @@ public class FakeEntityDamageEvent extends EntityDamageEvent { super(damagee, cause, damage); } - public static EnumMap> getFunctionModifiers() { + public static EnumMap> getFunctionModifiers(Map modifiers) { EnumMap> modifierFunctions = new EnumMap>(DamageModifier.class); Function ZERO = Functions.constant(-0.0); - for (DamageModifier modifier : DamageModifier.values()) { + for (DamageModifier modifier : modifiers.keySet()) { modifierFunctions.put(modifier, ZERO); }