[1.10.2] - Clientside crash while moving large schematic and when logging out
dsmall3303 opened this issue ยท 15 comments
I have a rather large schematic I saved from a world I downloaded, as I wanted to import some of the map into my own world. However, when I went to do so, moving the schematic seemed to cause the game to crash to desktop (first file). After reloading my world, I waited to make sure all the chunks were loaded, as I thought trying to move the schematic through unloaded chunks was the issue. I could move the schematic around just fine (if a bit laggy), but when I exited to the main menu, I crashed to desktop again (second file). If needed, I can also provide the relevant schematic.
Relevant stack traces, since those files are fairly large:
First crash:
java.lang.NullPointerException: Batching chunks
at com.github.lunatrius.schematica.client.renderer.SchematicRenderCache.func_180495_p(SchematicRenderCache.java:21)
at net.minecraft.client.renderer.chunk.RenderChunk.func_178581_b(RenderChunk.java:156)
at com.github.lunatrius.schematica.client.renderer.chunk.proxy.SchematicRenderChunkVbo.func_178581_b(SchematicRenderChunkVbo.java:46)
at net.minecraft.client.renderer.chunk.ChunkRenderWorker.func_178474_a(SourceFile:100)
at net.minecraft.client.renderer.chunk.ChunkRenderWorker.run(SourceFile:43)
at java.lang.Thread.run(Unknown Source)
This one is probably a null BlockPos being passed to getBlockState
.
Second crash:
java.lang.NullPointerException: Batching chunks
at net.minecraft.util.math.BlockPos.<init>(SourceFile:40)
at net.minecraft.client.renderer.chunk.ChunkRenderWorker.func_178474_a(SourceFile:65)
at net.minecraft.client.renderer.chunk.ChunkRenderWorker.run(SourceFile:43)
at java.lang.Thread.run(Unknown Source)
This one is probably a null something being passed to one of the BlockPos
constructors.
Not sure why either of those would happen.
Some questions:
- Just how large is this schematic? (If you don't know, it's displayed in F3 as WHL)
- Does this schematic contain mod blocks, or only vanilla blocks?
The crash should be impossible. This is the relevant code inside of RenderChunk.rebuildChunk
/RenderChunk.func_178581_b
:
for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos1))
{
IBlockState iblockstate = this.region.getBlockState(blockpos$mutableblockpos); // line 156
...
There's a lot of transformers loaded. I have a strong suspicion that one of them somehow makes BlockPos.getAllInBoxMutable
return null instead of a valid BlockPos instance.
Could you try creating a similar schematic in a "vanilla" environment (only Forge and Schematica) and then load it the same way you loaded this.
The second crash is similar (ChunkRenderWorker.processTask
/ChunkRenderWorker.func_178474_a
):
BlockPos blockpos = new BlockPos(Minecraft.getMinecraft().thePlayer);
The crash implies that the thePlayer
field is null, which should never be the case when you're in the game itself. Again, this is most likely a rogue transformer doing stuff that it's not supposed to do.
To answer Pokechu's questions:
-
The schematic is 314x105x145. I've attached it in case there's something funky going on with the way it was built.
FutureCity FarmComplex.zip -
Vanilla only.
To answer Lunatrius:
I made a new instance in MultiMC with only Forge 12.18.3.2477, Schematica, and LunatriusCore loaded. I was able to move the schematic around as expected, but when I exited to main menu, I once again crashed to desktop with the same error (or at least it looks like the same error at a cursory glance). I did notice that the schematic didn't seem to copy all of the blocks that I had expected it to; I don't know whether this is through a fault of my own or not, however. Could it be something in the way the structure I copied was constructed?
When saving schematics on the client you're limited to the currently loaded chunks, you can't save more than what's loaded.
Does it only happen with very large schematics?
I built a small cube to test, and it looks like I could move it around and close successfully. I'm guessing the schematic somehow tried to save an unloaded chunk and it's bugging out? Question marks?
I did some more messing around with the same large structure in a flat world and I think I have an idea of what might be causing an error (my knowledge of Forge is limited, so apologies if this is way off base): It seems that, even with my render distance turned up all the way, the schematic will only load so much of itself at once: looking left and looking right reveal parts of the schematic are not loading for whatever reason (or haven't yet loaded). Could this be part of the problem, or just a symptom?
It could be either. If you didn't save some chunks then that might indicate it was an incomplete save.
I made sure the structure was fully-rendered when I saved the schematic, and I didn't move until I received the message that Schematics had finished saving X chunks to the schematic. I suppose as a band-aid I can save the structure in smaller pieces, but is there anything that can be done about saving the whole thing? If it helps, I noticed that going closer to the parts that were not rendered in the screenshots caused them to load and other parts of the schematic to unload.
I noticed that going closer to the parts that were not rendered in the screenshots caused them to load and other parts of the schematic to unload.
Oh, in that case everything's completely saved. Schematica uses logic similar to (the same as?) vanilla to decide whether or not to render "chunks" in the schematic "world" - if you're far away some won't render.
If you save the schematic using the "mostly vanilla" setup (only Forge 12.18.3.2477, Schematica, and LunatriusCore) does the issue still happen? I know we already established that it happens with the schematic you already saved, but saving it with fewer mods may make a difference.
It does not crash to desktop upon exit when loaded in the mostly-vanilla world, though I could have sworn a few day ago it was...
Huh. Alright then. Can you attach both schematics (the one that you saved originally, and the one you saved from mostly vanilla) to this issue? (You'll probably need to put them into a zip file).
Here you go; the one with the 2 on the end is the one that was saved in the mostly vanilla environment
schematics.zip
Schematica uses a separate render distance setting that's available in the schematic config. By default it's set to a fairly low value to make sure that it can run on lower end computers without crashing the game before even starting up.
After a quick look at ResonatingCrystalBlock and ResonatingCrystalTileEntity there isn't anything obvious that would cause the crash (something like a null BlockPos
).
If the game doesn't crash in the mostly vanilla environment it's most likely a poorly written class transformer doing things that it's not supposed to do. One way to confirm this would be to do a binary search style of testing:
-
take all mods from the
mods
folder into a folder on your desktop, documents, wherever you wish -
take roughly half of the (remaining) mods (including their dependencies) and move them back to the
mods
folder -
test if the schematic loads, moves and unloads properly
a) if you don't crash go back to step 2
b) if you crash remove half of the previously added mods (you have to keep track of these somehow) and go back to step 3
It's a long and tedious process but it's the only way to find out which mod might be causing the (incompatibility) issues.
The one that crashes appears to have two "deepresonance:resonating_crystal
": one at 298/20/23 and another at 256/19/121. Those may be what's behind the crash, but I wouldn't expect such behavior exactly. (I'm also not entirely sure why there would be mod blocks in a vanilla downloaded world, but mods are known to do some weird things.) I'll continue to investigate.