aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0762-fix-entity-vehicle-collision-event-not-called.patch
blob: e39b0eaf22a823bf51cea26ea238b40cb1e4b288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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] fix 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 2bd3ba073843b1680eeb81f7dede5973bb4f446d..f403fc311a974558233028663dbe14c27b27d3f9 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -165,7 +165,15 @@ public abstract class AbstractMinecart extends VehicleEntity {
 
     @Override
     public boolean canCollideWith(Entity other) {
-        return Boat.canVehicleCollide(this, other);
+        // Paper start - fix 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 - fix VehicleEntityCollisionEvent not called when colliding with player
     }
 
     @Override