mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
SPIGOT-1515: Use CUSTOM reason for GENERIC damage
By: md_5 <git@md-5.net>
This commit is contained in:
parent
f2ad797555
commit
52f38c04ff
1 changed files with 2 additions and 2 deletions
|
@ -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<? super Double, Double> 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<Double, Double> hardHat, Function<Double, Double> blocking, Function<Double, Double> armor, Function<Double, Double> resistance, Function<Double, Double> magic, Function<Double, Double> absorption) {
|
||||
Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
|
||||
Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
|
||||
Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<DamageModifier, Function<? super Double, Double>>(DamageModifier.class);
|
||||
modifiers.put(DamageModifier.BASE, rawDamage);
|
||||
modifierFunctions.put(DamageModifier.BASE, ZERO);
|
||||
|
|
Loading…
Add table
Reference in a new issue