Glitchfiend / TerraBlender

TerraBlender is a library mod for adding biomes in a simple and compatible manner with Minecraft's new biome/terrain system.
https://www.curseforge.com/minecraft/mc-mods/terrablender
GNU Lesser General Public License v3.0
92 stars 30 forks source link

NPE caused by trees[uniqueness] #51

Closed Syndaryl closed 2 years ago

Syndaryl commented 2 years ago

What's the issue you encountered?

In play I have had two different worlds corrupted with the same error message (Latest crashlog, game log, and debug log attached) caused by a NPE thrown in terrablender.worldgen.TBClimate

java.lang.NullPointerException: Cannot invoke "terrablender.worldgen.TBClimate$RTree.search(terrablender.worldgen.TBClimate$TargetPoint, terrablender.worldgen.TBClimate$DistanceMetric)" because "this.trees[uniqueness]" is null

World generation mods that include new actual trees are restricted to BYG, Quark, Better Azalea, and Aquaculture, but I have no idea if something is including a "tree" that isn't really a tree. Possibly the giant mushrooms from YUNGs caves?

crash-2022-03-10_17.38.46-server.txt latest.log debug.log

How can the issue be reproduced?

Create a new minecraft world. Fly around for a while in observer mode. Takes just long enough that if you're just adventuring, you think everything is fine for hours and then BAM crash and you can't reopen the world.

I presume if it can figure out how to handle a tree who's uniqueness is null (?) then my worlds aren't actually corrupt.

Potential short term fix to skip tree placement if it hits a uniqueness NPE? Or provide a default value if it NPEs? Then possibly I can get my world back? :D

Logs

https://github.com/Glitchfiend/TerraBlender/files/8227637/crash-2022-03-10_17.38.46-server.txt

Mod Version

1.18.1-1.1.0.77

Additional information

Also tried with both BYG and BoP together, also got the error.

Adubbz commented 2 years ago

This has already been fixed in 1.18.2. The 1.18.1 codebase is completely different and thus the fix cannot be backported.

Syndaryl commented 2 years ago

OK, thank you for your continued work!

Sombrr commented 2 years ago

This has already been fixed in 1.18.2. The 1.18.1 codebase is completely different and thus the fix cannot be backported.

Any suggestions on how to fix it? Me and some friends did a lot of work on a Modded server and without terrablender it looks really jank in some places. Not all the mods are out for 1.18.2 yet.

Adubbz commented 2 years ago

There is nothing that can be done by end users. 1.18.2 made significant changes that forced TerraBlender to be completely changed in how it worked. Doing that fixed this issue.