public boolean onEntityCollision(Entity e) {
if (!this.isInteractable()) {
return false;
}
CollisionMode mode = this.getGroup().getProperties().getCollisionMode(e);
if (!mode.execute(this, e)) {
return false;
}
// Collision occurred, collided head-on? Stop the entire train
if (this.isHeadingTo(e)) {
this.getGroup().stop();