aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch')
-rw-r--r--patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch18
1 files changed, 15 insertions, 3 deletions
diff --git a/patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch
index e2cea1ed6d..de7e84ef8b 100644
--- a/patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch
+++ b/patches/api/0398-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch
@@ -65,10 +65,10 @@ index 641c71ab66bd2499b35cf3c1d533fd105d096e10..7dcbb75170296c1dd1d784a032bf3696
* Returns the list of blocks that would have been removed or were removed
* from the explosion event.
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
-index 5ba9f7edf3bb814844ba9599c622a5106394c897..03889ab9b26c6f8fa4c9f51b7f67ad3ff40ef5db 100644
+index 467a0d6cabc5e860628be3b1e62de773efde5d2e..1fb15e2ade8ff3c4d662eca87b078b4577f786e1 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
-@@ -10,18 +10,25 @@ import org.jetbrains.annotations.Nullable;
+@@ -11,28 +11,35 @@ import org.jetbrains.annotations.Nullable;
/**
* Called when an entity is damaged by a block
@@ -81,6 +81,12 @@ index 5ba9f7edf3bb814844ba9599c622a5106394c897..03889ab9b26c6f8fa4c9f51b7f67ad3f
private final Block damager;
+ private final org.bukkit.block.BlockState damagerBlockState; // Paper
+ @Deprecated(forRemoval = true)
+ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
+- this(damager, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), damage);
++ this(damager, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), damage, null); // Paper
+ }
+
- public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, final double damage) {
+ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, final double damage, final @Nullable org.bukkit.block.BlockState damagerBlockState) { // Paper
super(damagee, cause, damageSource, damage);
@@ -88,6 +94,12 @@ index 5ba9f7edf3bb814844ba9599c622a5106394c897..03889ab9b26c6f8fa4c9f51b7f67ad3f
+ this.damagerBlockState = damagerBlockState; // Paper
}
+ @Deprecated(forRemoval = true)
+ public EntityDamageByBlockEvent(@Nullable final Block 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) {
+- this(damager, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), modifiers, modifierFunctions);
++ this(damager, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), modifiers, modifierFunctions, null); // Paper
+ }
+
- public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
+ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, final @Nullable org.bukkit.block.BlockState damagerBlockState) { // Paper
super(damagee, cause, damageSource, modifiers, modifierFunctions);
@@ -96,7 +108,7 @@ index 5ba9f7edf3bb814844ba9599c622a5106394c897..03889ab9b26c6f8fa4c9f51b7f67ad3f
}
/**
-@@ -33,4 +40,20 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent {
+@@ -44,4 +51,20 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent {
public Block getDamager() {
return damager;
}