Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@40adc23 Fix incorrect javadoc in JarLibrary (#9513) PaperMC/Paper@c016e03 Fix unbreakable flint and steel consumed when igniting creepers (#9509) PaperMC/Paper@b1334b5 Mark Player.sendSignChange as deprecated (#9382) PaperMC/Paper@2f8d9db Pathfinder hasPath should check if path is done. (#9231) PaperMC/Paper@46a36d3 Make ExperienceOrb entities call EntitySpawnEvent (#9197) PaperMC/Paper@24d690f Fix hopper not marking source inv as changed (#9070) PaperMC/Paper@383f0ed Remove sign ticking (#9478) PaperMC/Paper@d8b8f61 Configurable Region Compression Format (#8505) PaperMC/Paper@2c54b39 Don't support hex in book title and author (#9493) PaperMC/Paper@e19177a Rewrote Amethyst logic to throw both BlockGrowEvent and BlockSpreadEvent (#9217) PaperMC/Paper@4283054 Add player whitelist events (#9209) PaperMC/Paper@aa93dcf feat: add minimessage tag resolvers overload to CommandSender#sendMessage (#9505) PaperMC/Paper@b14979e Remove isRemoved skip on .discard() (#9520) PaperMC/Paper@1837f6c Prevent entity removals if the entity slices is receiving status updates PaperMC/Paper@a40e48f Add cause to PlayerOpenSignEvent (#9441) PaperMC/Paper@7d1cc6d Add Translatable interface to MusicInstrument (#9538) PaperMC/Paper@6c7e3c5 Clarify viewers set mutability in chat events (#9525) PaperMC/Paper@f402f89 Bump net.kyori.ansi to 1.0.2 (#9546) PaperMC/Paper@81619a6 Fix treasure map config default (#9572) PaperMC/Paper@13c9d3c Bump net.kyori:ansi to 1.0.3 (#9575) PaperMC/Paper@2c55dd8 Expand use of strict advancement dim check (#9545) PaperMC/Paper@69a8013 Fix inventorycloseevent javadocs (#9533) PaperMC/Paper@2fa8efc Updated Upstream (Bukkit/CraftBukkit) (#9485) PaperMC/Paper@508a295 Only erase allay memory on non-item targets (#9570) PaperMC/Paper@31358d5 API for updating recipes on clients (#6463) PaperMC/Paper@8fe8ca6 Add clickable version on version command (#9347) PaperMC/Paper@d6d2b6f Only capture actual tree growth (#6464)
38 lines
2.9 KiB
Diff
38 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: lexikiq <noellekiq@gmail.com>
|
|
Date: Fri, 18 Jun 2021 14:04:39 -0400
|
|
Subject: [PATCH] Add origin location to EntityDamageByBlockEvent
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index 9d5b1851f719cb51a64f7aa904268867f1855d72..e2012fd752c3a5dcf604d7892bf3e01c354ce275 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -1021,7 +1021,7 @@ public class CraftEventFactory {
|
|
CraftEventFactory.entityDamage = null;
|
|
EntityDamageEvent event;
|
|
if (damager == null) {
|
|
- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage
|
|
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState, source.getEntity().getBukkitEntity().getLocation()); // Paper - handle block state in damage
|
|
} else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) {
|
|
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
|
} else {
|
|
@@ -1069,7 +1069,7 @@ public class CraftEventFactory {
|
|
|
|
return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
|
} else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {
|
|
- EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
|
+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions, null, entity.getBukkitEntity().getLocation());
|
|
event.setCancelled(cancelled);
|
|
CraftEventFactory.callEvent(event);
|
|
if (!event.isCancelled()) {
|
|
@@ -1079,7 +1079,7 @@ public class CraftEventFactory {
|
|
}
|
|
return event;
|
|
} else if (source.is(DamageTypes.LAVA)) {
|
|
- EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions));
|
|
+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions, null, blockDamage.getLocation()));
|
|
event.setCancelled(cancelled);
|
|
|
|
Block damager = CraftEventFactory.blockDamage;
|