Serene Seasons/Vivecraft NullPointer Error.
irihuman opened this issue ยท 7 comments
Vivecraft has a fancy 3d main menu that uses the typical minecraft blocks, I believe Serene Seasons attempts to apply "SeasonalFoliageColouring" and returns a null pointer error most likely due to there not actually being a season on the main menu. I will attach the log below in case I'm completely wrong.
VivecraftSSLog.txt
Are you using the latest version of the mod? Because this issue is the exact same as one that was fixed in it
Minecraft.player
must not be accessed from block-rendering code.
Since blocks may be rendered in a different thread, there's no guarantee that accessing Minecraft.player
from block rendering code actually gives you the correct player.
This is especially the case with BetterPortals (see Johni0702/BetterPortals#451, afaict same issue as this one) but could, on very rare occasions also happen with vanilla (there even used to be a similar bug in vanilla which was fixed in 1.13/14).
In the case Vivecraft, it doesn't even bother to initialize the player since you're still in the main menu and it's not required.
Minecraft.player
isn't accessed by our code, world
is. The best that can likely be done here is disabling seasonal colouring when world
is null, which may potentially cause other issues with these mods, but it's the best that can be done.
Yes it is, at least on master
which appears to be where the 1.12.2 version is living:
Edit: But yes, same applies to Minecraft.world
as well. Is there no way to access the world from that piece of code other than going through Minecraft.getInstance()
?
Oh I was referring to 1.15, as this would likely still be applicable there, and 1.15 is what we are actively developing for. World isn't exposed from the context applySeasonalFoliageColouring
/applySeasonalGrassColouring
are called from, only the biome and x and z coordinates.