-
Bug
-
Resolution: Invalid
-
None
-
Minecraft 1.14
-
None
-
{code:java}
Minecraft Version: 1.13.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 222077176 bytes (211 MB) / 704643072 bytes (672 MB) up to 2147483648 bytes (2048 MB)
LWJGL: 3.1.6 build 14 OpenGL: NO CONTEXT
GL Caps: Using GL 1.3 multitexturing.
{code}
*Using 1.13.2, not 1.14* but I couldn't select anything else ¯\_(ツ)_/¯{code:java} Minecraft Version: 1.13.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 222077176 bytes (211 MB) / 704643072 bytes (672 MB) up to 2147483648 bytes (2048 MB) LWJGL: 3.1.6 build 14 OpenGL: NO CONTEXT GL Caps: Using GL 1.3 multitexturing. {code} *Using 1.13.2, not 1.14* but I couldn't select anything else ¯\_(ツ)_/¯
-
Unconfirmed
-
(Unassigned)
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.