2022-10-22 19:09:45 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: lukas81298 <lukas81298@gmail.com>
|
|
|
|
Date: Tue, 12 Jan 2021 14:41:38 +0100
|
2024-01-16 12:41:40 +01:00
|
|
|
Subject: [PATCH] fix entity vehicle collision event not called
|
2022-10-22 19:09:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2024-06-14 03:30:23 +02:00
|
|
|
index 2bd3ba073843b1680eeb81f7dede5973bb4f446d..f403fc311a974558233028663dbe14c27b27d3f9 100644
|
2022-10-22 19:09:45 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2024-04-24 23:23:56 +02:00
|
|
|
@@ -165,7 +165,15 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
2022-10-22 19:09:45 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canCollideWith(Entity other) {
|
|
|
|
- return Boat.canVehicleCollide(this, other);
|
2024-01-16 12:41:40 +01:00
|
|
|
+ // Paper start - fix VehicleEntityCollisionEvent not called when colliding with player
|
2022-10-22 19:09:45 +02:00
|
|
|
+ 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();
|
2024-01-16 12:41:40 +01:00
|
|
|
+ // Paper end - fix VehicleEntityCollisionEvent not called when colliding with player
|
2022-10-22 19:09:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|