Attempt to patch Minecart crash

This commit is contained in:
business-goose 2022-03-23 23:04:52 +00:00
parent dca071141c
commit de44f0a564

View file

@ -146,15 +146,12 @@ public class EntityListener implements Listener {
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onVehicleCollisionEntity(VehicleEntityCollisionEvent event) { public void onVehicleCollisionEntity(VehicleEntityCollisionEvent event) {
event.setCollisionCancelled(true); if(event.getEntity() instanceof Vehicle) {
event.setPickupCancelled(true); event.setCollisionCancelled(true);
event.setCancelled(true); event.setPickupCancelled(true);
event.getVehicle().remove(); event.setCancelled(true);
} event.getVehicle().remove();
}
@EventHandler(priority = EventPriority.HIGH)
public void onVehicleCollisionBlock(VehicleBlockCollisionEvent event) {
event.getVehicle().remove();
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)