Paper/patches/server/0909-fixed-entity-vehicle-collision-event-not-called.patch

28 lines
1.3 KiB
Diff
Raw Normal View History

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
2022-12-07 23:05:32 +01:00
index fc95865a52e0bffaf55ca9f19e7e6005dcd2ae2e..eec7d7a5b558830111831792c42665724613af23 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
2022-12-07 23:05:32 +01:00
@@ -142,7 +142,15 @@ 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