From 702abbae4822ad2ce031c2837ad02f72ff844de3 Mon Sep 17 00:00:00 2001 From: business-goose Date: Wed, 23 Mar 2022 22:45:22 +0000 Subject: [PATCH] Attempt to patch Minecart crash --- .../TotalFreedomMod/listener/EntityListener.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/me/StevenLawson/TotalFreedomMod/listener/EntityListener.java b/src/main/java/me/StevenLawson/TotalFreedomMod/listener/EntityListener.java index ff9641f..1d8b3d2 100644 --- a/src/main/java/me/StevenLawson/TotalFreedomMod/listener/EntityListener.java +++ b/src/main/java/me/StevenLawson/TotalFreedomMod/listener/EntityListener.java @@ -6,6 +6,11 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.*; +import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; +import org.bukkit.event.vehicle.VehicleCollisionEvent; +import org.bukkit.event.vehicle.VehicleCreateEvent; +import org.bukkit.event.vehicle.VehicleMoveEvent; +import org.bukkit.util.Vector; public class EntityListener implements Listener { @EventHandler(priority = EventPriority.HIGH) @@ -140,6 +145,11 @@ public class EntityListener implements Listener { } } + @EventHandler(priority = EventPriority.HIGH) + public void onVehicleCollision(VehicleCollisionEvent event) { + event.getVehicle().setVelocity(new Vector(0, 0, 0)); + } + @EventHandler(priority = EventPriority.HIGH) public void onEntityDeath(EntityDeathEvent event) {