From d68e096dd894a3e4443d42c4708f72d674b7851f Mon Sep 17 00:00:00 2001
From: Lukas Alt <lukas81298@gmail.com>
Date: Sat, 22 Oct 2022 19:09:45 +0200
Subject: [PATCH] fixed entity vehicle collision event not called (#5053)

---
 ...y-vehicle-collision-event-not-called.patch | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 patches/server/fixed-entity-vehicle-collision-event-not-called.patch

diff --git a/patches/server/fixed-entity-vehicle-collision-event-not-called.patch b/patches/server/fixed-entity-vehicle-collision-event-not-called.patch
new file mode 100644
index 0000000000..0f9ec24850
--- /dev/null
+++ b/patches/server/fixed-entity-vehicle-collision-event-not-called.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: lukas81298 <lukas81298@gmail.com>
+Date: Tue, 12 Jan 2021 14:41:38 +0100
+Subject: [PATCH] fixed entity vehicle collision event not called
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
++++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+@@ -0,0 +0,0 @@ public abstract class AbstractMinecart extends Entity {
+ 
+     @Override
+     public boolean canCollideWith(Entity other) {
+-        return Boat.canVehicleCollide(this, other);
++        // Paper start - fixed VehicleEntityCollisionEvent not called when colliding with player
++        boolean collides = Boat.canVehicleCollide(this, other);
++        if (!collides) {
++            return false;
++        }
++        org.bukkit.event.vehicle.VehicleEntityCollisionEvent collisionEvent = new org.bukkit.event.vehicle.VehicleEntityCollisionEvent((org.bukkit.entity.Vehicle) getBukkitEntity(), other.getBukkitEntity());
++
++        return collisionEvent.callEvent();
++        // Paper end
+     }
+ 
+     @Override