mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 01:17:42 +01:00
Rebuild patches
This commit is contained in:
@@ -5,18 +5,39 @@ Subject: [PATCH] Add critical hit check to EntityDamagedByEntityEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
|
||||
index 869bad740..7ef65376a 100644
|
||||
index 869bad740..05fde759b 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
|
||||
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -10,15 +10,28 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class EntityDamageByEntityEvent extends EntityDamageEvent {
|
||||
private final Entity damager;
|
||||
+ private boolean isCritical; // Purpur
|
||||
+ private final boolean isCritical; // Purpur
|
||||
|
||||
public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
|
||||
+ // Purpur start
|
||||
+ this(damager, damagee, cause, damage, false);
|
||||
+ }
|
||||
+ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage, boolean isCritical) {
|
||||
+ // Purpur end
|
||||
super(damagee, cause, damage);
|
||||
@@ -30,4 +31,25 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent {
|
||||
this.damager = damager;
|
||||
+ this.isCritical = isCritical; // Purpur
|
||||
}
|
||||
|
||||
public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
|
||||
+ // Purpur start
|
||||
+ this(damager, damagee, cause, modifiers, modifierFunctions, false);
|
||||
+ }
|
||||
+ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, boolean isCritical) {
|
||||
+ // Purpur end
|
||||
super(damagee, cause, modifiers, modifierFunctions);
|
||||
this.damager = damager;
|
||||
+ this.isCritical = isCritical; // Purpur
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,4 +43,16 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent {
|
||||
public Entity getDamager() {
|
||||
return damager;
|
||||
}
|
||||
@@ -31,14 +52,5 @@ index 869bad740..7ef65376a 100644
|
||||
+ public boolean isCritical() {
|
||||
+ return this.isCritical;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether this damage was done by a critical hit
|
||||
+ *
|
||||
+ * @param isCritical True if critical hit
|
||||
+ */
|
||||
+ public void setCritical(boolean isCritical) {
|
||||
+ this.isCritical = isCritical;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user