From 68b4fb64275baa884858f0483681e6470d4afa6c Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 2 Apr 2018 12:55:28 +1000 Subject: [PATCH] SPIGOT-3882: Extra call site for VehicleEntityCollisionEvent --- nms-patches/EntityMinecartAbstract.patch | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nms-patches/EntityMinecartAbstract.patch b/nms-patches/EntityMinecartAbstract.patch index cff91691e9..7e9aac01da 100644 --- a/nms-patches/EntityMinecartAbstract.patch +++ b/nms-patches/EntityMinecartAbstract.patch @@ -206,7 +206,22 @@ this.motX *= 0.996999979019165D; this.motY *= 0.0D; this.motZ *= 0.996999979019165D; -@@ -780,4 +873,26 @@ +@@ -618,6 +711,14 @@ + if (!this.world.isClientSide) { + if (!entity.noclip && !this.noclip) { + if (!this.w(entity)) { ++ // CraftBukkit start ++ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); ++ this.world.getServer().getPluginManager().callEvent(collisionEvent); ++ ++ if (collisionEvent.isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + double d0 = entity.locX - this.locX; + double d1 = entity.locZ - this.locZ; + double d2 = d0 * d0 + d1 * d1; +@@ -780,4 +881,26 @@ } }