mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 08:20:51 +01:00
28 lines
1.3 KiB
Diff
28 lines
1.3 KiB
Diff
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 9780232286052d2cbbd604e71caf47dfb81fc1dc..c906ca07509939a06b9aaf2da0dafb172830a638 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
@@ -168,7 +168,15 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
|
|
|
@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
|