Rewrite worldregen and autorestart to make it more compatible