I've been experiencing this weird NPE crash for the last couple of weeks or so, while working on a server which does some custom terrain generation.
This crash occurs in both vanilla and modded (optifine, forge) versions of 1.13.2. The server mentioned also uses [ViaVersion|https://www.spigotmc.org/resources/viaversion.19254/] to support connections with 1.14. This is not the cause of the crash though, as I have also tested this without it, but it also catches a similar issue in the ChunkData packet, running out if ints to read here: https://github.com/ViaVersion/ViaVersion/blob/master/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java#L58 suggesting a null element or something in the biome chunk data.
According to the attached crash logs, the Exception occurs in the BiomeColors.class in the #getColor method. I've been trying to debug this for the past few days now, and I am a bit confused as to how this NPE can even occur. So for the stuff I figured out about the affected line:
#getColor of a BiomeColors$ColorResolver is called -> resolver can't be null as it is always a static variable passed in by one of the public methods in that class
#getBiome is called on the IWorldReaderBase argument -> can't be null either, since the BlockColors.class does a !=null check before even calling any of the BiomeColors methods (same goes for the BlockPos argument)
I tried overriding the GRASS_COLOR ColorResolver and noticed that the first argument (biome) can be null occasionally, so that might be the issue❓ . Though there's nothing on the server that should be able to cause a null Biome. Also, looking at the decompiled source, the NPE should occur in the Biome.class in #getTemperature, trying to get the y value of the possibly null BlockPos (maybe some decompiler weirdness, idk)
While digging around I also noticed that the WorldGenRegion.class' #getBiome method has actually checks if the returned biome is null and throws a RuntimeException, while other classes implementing that method don't.
As for the server (using PaperSpigot) I've also been digging around a bit and wasn't able to find anything that would cause a null Biome or empty array element in the ChunkData packet.
Attachments
Comments 2
I'm sure it's quite easy for you to just mark this as invalid, though I'd like to note that the affected classes remain unchanged (having the same issues) in the latest 1.14 version.
As for crash logs, there are 3 of those attached pointing to the classes mentioned (though the new obfuscated name of BiomeColors#getColor is dka#a).
I was already guessing that you wouldn't be supporting any modded versions, hence the attached crash log from a vanilla version.
Anyway, thanks for the reply. I'll be sure to get back to this if I get a chance to reproduce this in a complete 1.14 environment.
Thank you for your report!
However, this issue is Invalid.
Your Minecraft version is outdated. We currently take issues for version 1.14 and the latest snapshot.
Please update to the latest version as it includes the newest fixes. If you still have this problem after updating, then please create a new issue.
In case of a game crash, please also attach the crashlog.
Also, we don't provide support for third-party software such as spigot or forge.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki