Attempt to patch Minecart crash

This commit is contained in:
business-goose 2022-03-23 23:00:25 +00:00
parent 1de17695a0
commit dca071141c

View file

@ -142,14 +142,21 @@ public class EntityListener implements Listener {
} }
} }
//FIXME Make patch better
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onVehicleCollision(VehicleEntityCollisionEvent event) { public void onVehicleCollisionEntity(VehicleEntityCollisionEvent event) {
event.setCollisionCancelled(true); event.setCollisionCancelled(true);
event.setPickupCancelled(true); event.setPickupCancelled(true);
event.setCancelled(true); event.setCancelled(true);
event.getVehicle().remove(); event.getVehicle().remove();
} }
@EventHandler(priority = EventPriority.HIGH)
public void onVehicleCollisionBlock(VehicleBlockCollisionEvent event) {
event.getVehicle().remove();
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onEntityDeath(EntityDeathEvent event) public void onEntityDeath(EntityDeathEvent event)
{ {