blushiemagic / MagicStorage

A tModLoader mod for Terraria
MIT License
177 stars 101 forks source link

Magic Storage throws a silent exception on world generation #190

Open Biohazard12947 opened 2 years ago

Biohazard12947 commented 2 years ago

When creating a world with magic storage enabled it undergoes normal world generation until it reaches the end and the status bar disappears and you just get a blank tmodloader screen. I had added mods until I was met with this issue and I also tried magic storage by itself but still ran into the same issue

[04:18:56] [.NET ThreadPool Worker/WARN] [tML]: Silently Caught Exception: System.ArgumentNullException: Value cannot be null. (Parameter 'source') at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector) at MagicStorage.StorageWorld.SaveWorldData(TagCompound tag) in MagicStorage\StorageWorld.cs:line 86 at Terraria.ModLoader.IO.WorldIO.SaveModData() in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 470 at Terraria.ModLoader.IO.WorldIO.Save(String path, Boolean isCloudSave) in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 25 at Terraria.IO.WorldFile.InternalSaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 563 at Terraria.IO.WorldFile.<>c__DisplayClass57_0.b__0() in tModLoader\Terraria\IO\WorldFile.cs:line 499 at Terraria.Utilities.FileUtilities.ProtectedInvoke(Action action) in tModLoader\Terraria\Utilities\FileUtilities.cs:line 170 at Terraria.IO.WorldFile.SaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 498 at Terraria.WorldGen.do_worldGenCallBack(Object threadContext) in tModLoader\Terraria\WorldGen.cs:line 2346 at Terraria.WorldGen.worldGenCallback(Object threadContext) in tModLoader\Terraria\WorldGen.cs:line 2335 at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

[04:18:56] [.NET ThreadPool Worker/ERROR] [Terraria]: A problem was encountered during world generation System.ArgumentNullException: Value cannot be null. (Parameter 'source') at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector) at MagicStorage.StorageWorld.SaveWorldData(TagCompound tag) in MagicStorage\StorageWorld.cs:line 86 at Terraria.ModLoader.IO.WorldIO.SaveModData() in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 470 at Terraria.ModLoader.IO.WorldIO.Save(String path, Boolean isCloudSave) in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 25 at Terraria.IO.WorldFile.InternalSaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 563 at Terraria.IO.WorldFile.<>c__DisplayClass57_0.b__0() in tModLoader\Terraria\IO\WorldFile.cs:line 499 at Terraria.Utilities.FileUtilities.ProtectedInvoke(Action action) in tModLoader\Terraria\Utilities\FileUtilities.cs:line 170 at Terraria.IO.WorldFile.SaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 498 at Terraria.WorldGen.do_worldGenCallBack(Object threadContext) in tModLoader\Terraria\WorldGen.cs:line 2346 at Terraria.WorldGen.worldGenCallback(Object threadContext) in tModLoader\Terraria\WorldGen.cs:line 2335

I end up having to alt F4 and relaunch. In doing so I find the world has been created except there are missing biomes like the Abyss from Calamity.

Biohazard12947 commented 2 years ago

A workaround could be to create the world without magic storage and then add it after