This mod provides a workaround for the sudden teleport to infinity bug.
It will store the player's location every second, and teleport them back if they are beyond the map.
If the player has no good location (logged in outside of the map), it will return them to their spawnpoint.
This mod is compatible with the various PilzAdam-based beds mods and protection_lagporter.