Attempt to patch Minecart crash

This commit is contained in:
business-goose 2022-03-23 22:54:58 +00:00
parent 702abbae48
commit 5ccf83ecec

View file

@ -6,10 +6,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.*; import org.bukkit.event.entity.*;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.*;
import org.bukkit.event.vehicle.VehicleCollisionEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
public class EntityListener implements Listener { public class EntityListener implements Listener {
@ -146,8 +143,8 @@ public class EntityListener implements Listener {
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onVehicleCollision(VehicleCollisionEvent event) { public void onVehicleCollision(VehicleEntityCollisionEvent event) {
event.getVehicle().setVelocity(new Vector(0, 0, 0)); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)