Added centralized handling for entity collisions.