mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-08-24 23:03:00 +02:00
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 7ea04e202d29e9eedf93909cc35667ebd6f9e905 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Wed, 20 Dec 2017 21:42:45 -0500
|
|
Subject: [PATCH] EMC EntityAttackedEntityEvent
|
|
|
|
For when you need to know one Entity has attacked another entity
|
|
and that the damage event was not cancelled.
|
|
---
|
|
.../org/bukkit/craftbukkit/event/CraftEventFactory.java | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index ce8d7877a..b661951ef 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -1008,7 +1008,14 @@ public class CraftEventFactory {
|
|
callEvent(event);
|
|
|
|
if (!event.isCancelled()) {
|
|
+ // Paper start
|
|
+ if (damager != null && !com.destroystokyo.paper.event.entity.EntityAttackedEntityEvent.callEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, event.getFinalDamage())) {
|
|
+ event.setCancelled(true);
|
|
+ return event;
|
|
+ }
|
|
+ // Paper end
|
|
event.getEntity().setLastDamageCause(event);
|
|
+
|
|
}
|
|
|
|
return event;
|
|
--
|
|
2.25.1.windows.1
|
|
|