If you can, get an UPS. Mine has saved a few Terraria worlds from the same fate in the same circumstances. Also - real backups (not cloud saves).