2013-12-06 10:32:13 +01:00
|
|
|
From 86d7a42c6a245d2f9675abb33bf63d9f076bffe9 Mon Sep 17 00:00:00 2001
|
2013-12-05 08:41:50 +01:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Thu, 5 Dec 2013 18:41:32 +1100
|
|
|
|
Subject: [PATCH] Fire EntityDamageByEntityEvent for ItemFrames
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
2013-12-06 10:32:13 +01:00
|
|
|
index 261d0c1..0fdcffe 100644
|
2013-12-05 08:41:50 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityItemFrame.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
2013-12-06 10:32:13 +01:00
|
|
|
@@ -23,6 +23,18 @@ public class EntityItemFrame extends EntityHanging {
|
2013-12-05 08:41:50 +01:00
|
|
|
return false;
|
|
|
|
} else if (this.getItem() != null) {
|
|
|
|
if (!this.world.isStatic) {
|
|
|
|
+ // Spigot Start
|
2013-12-06 10:32:13 +01:00
|
|
|
+ if ( damagesource.getEntity() != null )
|
2013-12-05 08:41:50 +01:00
|
|
|
+ {
|
2013-12-06 10:32:13 +01:00
|
|
|
+ org.bukkit.event.entity.EntityDamageByEntityEvent event = new org.bukkit.event.entity.EntityDamageByEntityEvent(
|
|
|
|
+ damagesource.getEntity().getBukkitEntity(), getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, f );
|
|
|
|
+ getBukkitEntity().getServer().getPluginManager().callEvent( event );
|
|
|
|
+ if ( event.isCancelled() )
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
2013-12-05 08:41:50 +01:00
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
this.b(damagesource.getEntity(), false);
|
|
|
|
this.setItem((ItemStack) null);
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.8.3.2
|
|
|
|
|