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
|
|
|
|
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
|
2023-09-22 17:51:48 +02:00
|
|
|
index 350d931f99bea1291f890d87fca6ae644c1a9fe9..44a6118d3bd67a95180f750c17967561946e2e87 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
|
2023-09-22 17:51:48 +02:00
|
|
|
@@ -149,7 +149,15 @@ public abstract class AbstractMinecart extends Entity {
|
2022-10-22 19:09:45 +02:00
|
|
|
|
|
|
|
@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
|