2013-04-10 12:06:41 +08:00
|
|
|
From 0e94cb04fd0f2a6c99cf935a76238ea755bc42a1 Mon Sep 17 00:00:00 2001
|
2013-03-02 06:38:27 +08:00
|
|
|
From: Yariv Livay <yarivlivay@gmail.com>
|
|
|
|
Date: Sat, 2 Mar 2013 09:36:52 +1100
|
2013-04-10 10:36:11 +08:00
|
|
|
Subject: [PATCH] BUKKIT-3661, fixed missing HangingBreakEvent when
|
|
|
|
EntityHanging moves
|
2013-03-02 06:38:27 +08:00
|
|
|
|
|
|
|
---
|
2013-04-10 10:36:11 +08:00
|
|
|
src/main/java/net/minecraft/server/EntityHanging.java | 15 +++++++++++++++
|
|
|
|
1 file changed, 15 insertions(+)
|
2013-03-02 06:38:27 +08:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java
|
2013-03-25 15:57:00 +08:00
|
|
|
index f697d85..1dfb02f 100644
|
2013-03-02 06:38:27 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHanging.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHanging.java
|
2013-03-25 15:57:00 +08:00
|
|
|
@@ -260,6 +260,21 @@ public abstract class EntityHanging extends Entity {
|
2013-03-02 06:38:27 +08:00
|
|
|
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
|
|
|
|
if (dead) return; // CraftBukkit
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.PHYSICS);
|
|
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ PaintingBreakEvent paintingEvent = null;
|
|
|
|
+ if (this instanceof EntityPainting) {
|
|
|
|
+ // Fire old painting event until it can be removed
|
|
|
|
+ paintingEvent = new PaintingBreakEvent((Painting) this.getBukkitEntity(), PaintingBreakEvent.RemoveCause.valueOf(event.getCause().name()));
|
|
|
|
+ paintingEvent.setCancelled(event.isCancelled());
|
|
|
|
+ this.world.getServer().getPluginManager().callEvent(paintingEvent);
|
|
|
|
+ }
|
|
|
|
+ if (event.isCancelled() || (paintingEvent != null && paintingEvent.isCancelled())) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.die();
|
|
|
|
this.h();
|
|
|
|
}
|
|
|
|
--
|
2013-04-10 10:36:11 +08:00
|
|
|
1.8.2.1
|
2013-03-02 06:38:27 +08:00
|
|
|
|