aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLukas Alt <[email protected]>2022-10-22 19:09:45 +0200
committerGitHub <[email protected]>2022-10-22 12:09:45 -0500
commit60da35e359385a4f2e09f5c67bd4a7f3b0beefe8 (patch)
treee6f95b845a5ff81e764959897fecfdb8fb042f3d
parent7187cab3b69334356a970c48329e3c78fa8f6edb (diff)
downloadPaper-60da35e359385a4f2e09f5c67bd4a7f3b0beefe8.tar.gz
Paper-60da35e359385a4f2e09f5c67bd4a7f3b0beefe8.zip
fixed entity vehicle collision event not called (#5053)
-rw-r--r--patches/server/0930-fixed-entity-vehicle-collision-event-not-called.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0930-fixed-entity-vehicle-collision-event-not-called.patch b/patches/server/0930-fixed-entity-vehicle-collision-event-not-called.patch
new file mode 100644
index 0000000000..38afe823d5
--- /dev/null
+++ b/patches/server/0930-fixed-entity-vehicle-collision-event-not-called.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: lukas81298 <[email protected]>
+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 3f31a3c17ecca6e93b794478129b95ecff4e1a9c..c71120fe57a76c4638be5dcbda5a756cc2d62ffc 100644
+--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
++++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+@@ -143,7 +143,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